CVS update: php3/functions

From: Date: Fri, 09 Oct 1998 04:39:41 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-1747@lists.php.net to get a copy of this message
Date: Friday October 9, 1998 @ 0:39 Author: zeev Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv27320/functions Modified Files: mime.c Log Message: Memory leak fix Index: php3/functions/mime.c diff -c php3/functions/mime.c:1.54 php3/functions/mime.c:1.55 *** php3/functions/mime.c:1.54 Tue Aug 25 15:56:38 1998 --- php3/functions/mime.c Fri Oct 9 00:39:41 1998 *************** *** 26,32 **** | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ ! /* $Id: mime.c,v 1.54 1998/08/25 19:56:38 rasmus Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 26,32 ---- | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ ! /* $Id: mime.c,v 1.55 1998/10/09 04:39:41 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 97,103 **** --- 97,109 ---- php3_error(E_WARNING, "File Upload Mime headers garbled [%c%c%c%c%c]", *name, *(name + 1), *(name + 2), *(name + 3), *(name + 4)); SAFE_RETURN; } + if (namebuf) { + efree(namebuf); + } namebuf = estrndup(name, s-name); + if (lbuf) { + efree(lbuf); + } lbuf = emalloc(s-name + MAX(MAX(sizeof("_name"),sizeof("_size")),sizeof("_type"))); state = 2; loc2 = memchr(loc + 1, '\n', rem); *************** *** 114,119 **** --- 120,128 ---- if (!s) { php3_error(E_WARNING, "File Upload Mime headers garbled [%c%c%c%c%c]", *filename, *(filename + 1), *(filename + 2), *(filename + 3), *(filename + 4)); SAFE_RETURN; + } + if (filenamebuf) { + efree(filenamebuf); } filenamebuf = estrndup(filename, s-filename); sprintf(lbuf, "%s_name", namebuf); -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1747) next »