[vlc-commits] Fix memory leak (cid #1049518)

Rémi Duraffort git at videolan.org
Mon Jul 22 17:34:27 CEST 2013


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jul 22 17:01:40 2013 +0200| [231117945693d34d1a7075ff1d5e9b86ffd16d92] | committer: Rémi Duraffort

Fix memory leak (cid #1049518)

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

 lib/vlm.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/vlm.c b/lib/vlm.c
index ed3d7e4..aad066b 100644
--- a/lib/vlm.c
+++ b/lib/vlm.c
@@ -263,11 +263,16 @@ static char* recurse_answer( vlm_message_t *p_answer, const char* psz_delim,
              * inside a list), create a property of its name as if it
              * had a name value node
              */
+            free( psz_nametag );
             if( i_list )
             {
                 i_success = asprintf( &psz_nametag, "\"name\": \"%s\",%s",
                               aw_child->psz_name, psz_childdelim );
-                if( i_success == -1 ) break;
+                if( i_success == -1 )
+                {
+                    psz_nametag = NULL;
+                    break;
+                }
             }
             else
             {



More information about the vlc-commits mailing list