vlc | branch: master | Rémi Denis-Courmont <r...@remlab.net> | Mon Feb 12 
23:17:51 2018 +0200| [6a0bc8f944fafc59b89c4d9fd5b4801045df64ab] | committer: 
Rémi Denis-Courmont

sout: handle an error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6a0bc8f944fafc59b89c4d9fd5b4801045df64ab
---

 src/stream_output/stream_output.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/stream_output/stream_output.c 
b/src/stream_output/stream_output.c
index 702eec785a..80320160a5 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -257,6 +257,8 @@ sout_access_out_t *sout_AccessOutNew( vlc_object_t *p_sout,
                                    psz_access );
     free( psz_next );
     p_access->psz_path   = strdup( psz_name ? psz_name : "" );
+    if( unlikely(p_access->psz_path == NULL) )
+        goto error;
     p_access->p_sys      = NULL;
     p_access->pf_seek    = NULL;
     p_access->pf_read    = NULL;
@@ -269,8 +271,9 @@ sout_access_out_t *sout_AccessOutNew( vlc_object_t *p_sout,
 
     if( !p_access->p_module )
     {
-        free( p_access->psz_access );
         free( p_access->psz_path );
+error:
+        free( p_access->psz_access );
         vlc_object_release( p_access );
         return( NULL );
     }

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to