macosx: fix use after free for video effects string
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Thu, 14 Nov 2013 12:11:29 +0000 (13:11 +0100)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Fri, 15 Nov 2013 16:57:11 +0000 (17:57 +0100)
This bug resulted in failure of setting more than one video effect
filter on mavericks.

close #9849

modules/gui/macosx/VideoEffects.m

index 838e4c0..6f413cb 100644 (file)
@@ -524,8 +524,9 @@ static VLCVideoEffects *_o_sharedInstance = nil;
             free(psz_string);
             psz_string = strdup(psz_name);
         } else if (strstr(psz_string, psz_name) == NULL) {
+            char *psz_tmp = strdup([[NSString stringWithFormat: @"%s:%s", psz_string, psz_name] UTF8String]);
             free(psz_string);
-            psz_string = strdup([[NSString stringWithFormat: @"%s:%s", psz_string, psz_name] UTF8String]);
+            psz_string = psz_tmp;
         }
     } else {
         if (!psz_string)