[vlc-commits] sout: handle an error

Rémi Denis-Courmont git at videolan.org
Mon Feb 12 22:19:28 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at 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 );
     }



More information about the vlc-commits mailing list