diff options
-rw-r--r-- | ext/ftp/ftp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index b980d69708..bce51ab6ee 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -1646,9 +1646,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; } /* }}} */ |