From: Sara Golemon Date: Thu, 13 Feb 2003 22:18:20 +0000 (+0000) Subject: Buf #22052 More casual efree()ing causing segfaults X-Git-Tag: php-4.3.2RC1~215 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=261860cfeca2df8c6b7cbc959233b2342742992d;p=php Buf #22052 More casual efree()ing causing segfaults --- diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index b1c905e5a1..761e5fbf47 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -1460,7 +1460,6 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) char **entry; char *text; - if ((tmpfp = tmpfile()) == NULL) return NULL; @@ -1538,9 +1537,11 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) return ret; bail: - data_close(ftp, data); + if (data) + data_close(ftp, data); fclose(tmpfp); - efree(ret); + if (ret) + efree(ret); return NULL; } /* }}} */