cvs: php4 /ext/standard head.c

From: Date: Fri, 09 Aug 2002 20:53:37 +0000
Subject: cvs: php4 /ext/standard head.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13236@lists.php.net to get a copy of this message
helly Fri Aug 9 16:53:37 2002 EDT Modified files: /php4/ext/standard head.c Log: possible memoryleak Index: php4/ext/standard/head.c diff -u php4/ext/standard/head.c:1.59 php4/ext/standard/head.c:1.60 --- php4/ext/standard/head.c:1.59 Mon Jul 8 08:52:22 2002 +++ php4/ext/standard/head.c Fri Aug 9 16:53:37 2002 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c,v 1.59 2002/07/08 12:52:22 derick Exp $ */ +/* $Id: head.c,v 1.60 2002/08/09 20:53:37 helly Exp $ */ #include <stdio.h> #include "php.h" @@ -69,6 +69,7 @@ time_t t; char *dt; sapi_header_line ctr = {0}; + int result; len += name_len; if (value) { @@ -124,7 +125,11 @@ ctr.line = cookie; ctr.line_len = strlen(cookie); - return sapi_header_op(SAPI_HEADER_ADD, &ctr TSRMLS_CC); + result = sapi_header_op(SAPI_HEADER_ADD, &ctr TSRMLS_CC); + if (result == FAILURE) { + efree(cookie); + } + return result; }

« previous php.cvs (#13236) next »