# HG changeset patch # User Pascal Dupuis # Date 1296380315 18000 # Node ID 2c35dfd641fffa1d5a601734543f0ffa3db9a347 # Parent 1b71befc2f409ed67697aa8754f4e466636e34d0 lo-sysdep.cc (opendir): on error, free allocated DIR object befor returning diff -r 1b71befc2f40 -r 2c35dfd641ff liboctave/ChangeLog --- a/liboctave/ChangeLog Sun Jan 30 04:38:10 2011 -0500 +++ b/liboctave/ChangeLog Sun Jan 30 04:38:35 2011 -0500 @@ -1,3 +1,8 @@ +2011-01-30 Pascal Dupuis + + * lo-sysdep.cc (opendir): On error, free allocated DIR object + before returning. + 2011-01-28 John W. Eaton * eigs-base.cc: Remove #endif corresponding to "#ifdef HAVE_ARPACK", diff -r 1b71befc2f40 -r 2c35dfd641ff liboctave/lo-sysdep.cc --- a/liboctave/lo-sysdep.cc Sun Jan 30 04:38:10 2011 -0500 +++ b/liboctave/lo-sysdep.cc Sun Jan 30 04:38:35 2011 -0500 @@ -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; }