changeset 609:877dba1b8a1f

Fix some resource code checks.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 12 Apr 2013 11:46:17 +0300
parents 9620208f7ff4
children e74ad60b1e85
files dmres.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dmres.c	Fri Apr 12 11:33:56 2013 +0300
+++ b/dmres.c	Fri Apr 12 11:46:17 2013 +0300
@@ -566,7 +566,7 @@
  */
 static void dmf_reset(DMResource *handle)
 {
-    if (handle->fops != NULL)
+    if (handle != NULL && handle->fops != NULL)
         dmfseek(handle, 0, SEEK_SET);
 }
 
@@ -589,8 +589,9 @@
 #else
         handle->fops = NULL;
 #endif
+
+        dmf_reset(handle);
     }
-    dmf_reset(handle);
 }