[vlc-commits] [Git][videolan/vlc][master] resource: fix memory leak on error (fixes #26334)

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Tue Nov 30 08:35:50 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
3e47a7cb by Rémi Denis-Courmont at 2021-11-30T08:20:48+00:00
resource: fix memory leak on error (fixes #26334)

- - - - -


1 changed file:

- src/input/resource.c


Changes:

=====================================
src/input/resource.c
=====================================
@@ -602,8 +602,11 @@ sout_stream_t *input_resource_RequestSout( input_resource_t *p_resource, const c
         /* Create a new one */
         p_resource->psz_sout = strdup(psz_sout);
 
-        if (likely(p_resource->psz_sout != NULL))
+        if (likely(p_resource->psz_sout != NULL)) {
             sout = sout_NewInstance(p_resource->p_parent, psz_sout);
+            if (sout == NULL)
+                free(p_resource->psz_sout);
+        }
     }
 #else
     sout = NULL;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3e47a7cb8bff9135e08c8ff6731fac0afe87facd

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3e47a7cb8bff9135e08c8ff6731fac0afe87facd
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list