comparison 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
comparison
equal deleted inserted replaced
12222:91fa3871e9bf 12223:677be77b684b
170 else 170 else
171 strncat (buffer, "*", MAX_PATH); 171 strncat (buffer, "*", MAX_PATH);
172 d->current = buffer; 172 d->current = buffer;
173 d->hnd = FindFirstFile (buffer, &(d->fd)); 173 d->hnd = FindFirstFile (buffer, &(d->fd));
174 if (d->hnd == INVALID_HANDLE_VALUE) 174 if (d->hnd == INVALID_HANDLE_VALUE)
175 return 0; 175 {
176 free (d);
177 return 0;
178 }
176 d->dirty = 1; 179 d->dirty = 1;
177 return d; 180 return d;
178 } 181 }
179 182
180 void 183 void