]> git.sesse.net Git - vlc/commitdiff
DirectDraw: do not save a string that is deallocated immediately after.
authorFelix Abecassis <felix.abecassis@gmail.com>
Mon, 20 Jan 2014 15:30:13 +0000 (16:30 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 20 Jan 2014 15:44:33 +0000 (16:44 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/video_output/msw/directx.c

index 42906f497717e424552a869b3f1881b4e410c7a6..cb48b73a551bf09331bdaea9486a53c511768c64 100644 (file)
@@ -1424,8 +1424,8 @@ static BOOL WINAPI DirectXEnumCallback2(GUID *guid, LPTSTR desc,
     ctx->values = xrealloc(ctx->values, (ctx->count + 1) * sizeof(char *));
     ctx->descs = xrealloc(ctx->descs, (ctx->count + 1) * sizeof(char *));
 
-    ctx->values[ctx->count] = psz_drivername;
-    ctx->descs[ctx->count] = psz_drivername;
+    ctx->values[ctx->count] = strdup(psz_drivername);
+    ctx->descs[ctx->count] = strdup(psz_drivername);
     ctx->count++;
 
     free(psz_drivername);