cvs: php4 /ext/informix ifx.ec

From: Date: Mon, 04 Sep 2000 21:18:06 +0000
Subject: cvs: php4 /ext/informix ifx.ec
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1556@lists.php.net to get a copy of this message
danny Mon Sep 4 14:18:06 2000 EDT Modified files: /php4/ext/informix ifx.ec Log: - remove a memory leak warning and fix a crash when tempnam() failed for some reason (danny). Index: php4/ext/informix/ifx.ec diff -u php4/ext/informix/ifx.ec:1.47 php4/ext/informix/ifx.ec:1.48 --- php4/ext/informix/ifx.ec:1.47 Sat Aug 12 05:03:39 2000 +++ php4/ext/informix/ifx.ec Mon Sep 4 14:18:06 2000 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ifx.ec,v 1.47 2000/08/12 12:03:39 danny Exp $ */ +/* $Id: ifx.ec,v 1.48 2000/09/04 21:18:06 danny Exp $ */ /* ------------------------------------------------------------------- * if you want a function reference : "grep '^\*\*' ifx.ec" will give @@ -1805,11 +1805,16 @@ ifx_errmsg[0] = 0; } - returnmsg = (char *) emalloc(strlen(ifx_errmsg) + 128); + returnmsg = (char *) malloc(strlen(ifx_errmsg) + 128); sprintf(returnmsg,ifx_errmsg, sqlca.sqlerrm); free(ifx_errmsg); + //RETURN_STRING(returnmsg,1); // can not use the macro, have to free the memory + return_value->value.str.len = strlen(returnmsg); + return_value->value.str.val = estrndup(returnmsg,return_value->value.str.len); + return_value->type = IS_STRING; + free(returnmsg); + return; - RETURN_STRING(returnmsg,0); /* do not dup, emalloced ! */ } /* }}} */ @@ -3783,6 +3788,10 @@ sprintf(filename,"blb%d",(int)bid); blobfile=tempnam(blobdir,filename); free(blobdir); + + if (blobfile == NULL) + return NULL; + retval=emalloc(strlen(blobfile)+1); if(retval==NULL) return NULL;

« previous php.cvs (#1556) next »