]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/ftp.c
Merge commit '91d305790ea0f6fe0f54b48236da42181c39c18b'
[ffmpeg] / libavformat / ftp.c
index 9ee9b1630fc411f70fbc3faf95b7fcc9b52bd20f..7faf4a5d66c44d8aa5dc218380a169a6a7496b24 100644 (file)
@@ -183,6 +183,9 @@ static int ftp_send_command(FTPContext *s, const char *command,
 {
     int err;
 
+    if (response)
+        *response = NULL;
+
     if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0)
         return err;
     if (!err)
@@ -444,12 +447,14 @@ static int ftp_features(FTPContext *s)
     static const char *enable_utf8_command = "OPTS UTF8 ON\r\n";
     static const int feat_codes[] = {211, 0};
     static const int opts_codes[] = {200, 451};
-    char *feat;
+    char *feat = NULL;
 
     if (ftp_send_command(s, feat_command, feat_codes, &feat) == 211) {
         if (av_stristr(feat, "UTF8"))
             ftp_send_command(s, enable_utf8_command, opts_codes, NULL);
     }
+    av_freep(&feat);
+
     return 0;
 }