svn commit: samba r2600 - in trunk/source/lib: .
idra at samba.org
idra at samba.org
Fri Sep 24 17:39:44 GMT 2004
Author: idra
Date: 2004-09-24 17:39:44 +0000 (Fri, 24 Sep 2004)
New Revision: 2600
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/trunk/source/lib&rev=2600&nolog=1
Log:
same fix as in 3.0 (avoid free()ing unallocated memory)
Modified:
trunk/source/lib/xfile.c
Changeset:
Modified: trunk/source/lib/xfile.c
===================================================================
--- trunk/source/lib/xfile.c 2004-09-24 17:38:23 UTC (rev 2599)
+++ trunk/source/lib/xfile.c 2004-09-24 17:39:44 UTC (rev 2600)
@@ -135,7 +135,12 @@
memset(f->buf, 0, f->bufsize);
SAFE_FREE(f->buf);
}
- SAFE_FREE(f);
+ /* check the file descriptor given to the function is NOT one of the static
+ * descriptor of this libreary or we will free unallocated memory
+ * --sss */
+ if (f != x_stdin && f != x_stdout && f != x_stderr) {
+ SAFE_FREE(f);
+ }
return ret;
}
More information about the samba-cvs
mailing list