ftpd: free allocated string on error path
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 10 Jul 2012 22:26:24 +0000 (00:26 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 10 Jul 2012 22:26:24 +0000 (00:26 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/ftpd.c

index 4ba96cfc2c718ef1ca2d73a99bbe6cf750394fc4..33db964fa46c465b72bda6fa75c65adee1873ee0 100644 (file)
@@ -927,6 +927,7 @@ handle_upload_common(int is_append, int is_unique)
         || fstat(local_file_fd, &statbuf) != 0
         || !S_ISREG(statbuf.st_mode)
        ) {
+               free(tempname);
                WRITE_ERR(FTP_UPLOADFAIL);
                if (local_file_fd >= 0)
                        goto close_local_and_bail;