]> granicus.if.org Git - php/commitdiff
Buf #22052 More casual efree()ing causing segfaults
authorSara Golemon <pollita@php.net>
Thu, 13 Feb 2003 22:18:20 +0000 (22:18 +0000)
committerSara Golemon <pollita@php.net>
Thu, 13 Feb 2003 22:18:20 +0000 (22:18 +0000)
ext/ftp/ftp.c

index b1c905e5a10cd0753b5e72c5669445d609bc0d2b..761e5fbf472e11c4fb76961ae99d27573a9d1eb3 100644 (file)
@@ -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;
 }
 /* }}} */