diff liboctave/lo-sysdep.cc @ 12223:677be77b684b

lo-sysdep.cc (opendir): on error, free allocated DIR object befor returning
author Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
date Sun, 30 Jan 2011 04:38:35 -0500
parents fd0a3ac60b0e
children 72c96de7a403
line wrap: on
line diff
--- a/liboctave/lo-sysdep.cc
+++ b/liboctave/lo-sysdep.cc
@@ -172,7 +172,10 @@
   d->current = buffer;
   d->hnd = FindFirstFile (buffer, &(d->fd));
   if (d->hnd == INVALID_HANDLE_VALUE)
-    return 0;
+    {
+      free (d);
+      return 0;
+    }
   d->dirty = 1;
   return d;
 }