variables: fix callback setup leak with non existent variable
authorFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 13 Feb 2019 11:14:22 +0000 (12:14 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 13 Feb 2019 11:14:22 +0000 (12:14 +0100)
src/misc/variables.c

index a07684c..871c463 100644 (file)
@@ -776,6 +776,7 @@ static void AddCallback( vlc_object_t *p_this, const char *psz_name,
         vlc_mutex_unlock( &p_priv->var_lock );
         msg_Err( p_this, "cannot add callback %p to nonexistent variable '%s'",
                  entry->p_callback, psz_name );
+        free( entry );
         return;
     }