]> git.sesse.net Git - vlc/blobdiff - src/playlist/tree.c
Assert that allocate object size makes sense
[vlc] / src / playlist / tree.c
index 94e587141065114c3756b4be63212d835d2dd160..35f50cff7dbcce0a4e9dc17c4f496ddf95904229 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <assert.h>
 #include "vlc_playlist.h"
@@ -65,6 +69,8 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist,
                                         psz_name, 0, NULL, -1, ITEM_TYPE_NODE );
     p_item = playlist_ItemNewFromInput( VLC_OBJECT(p_playlist),
                                         p_input ? p_input : p_new_input );
+    if( !p_input )
+        vlc_gc_decref( p_new_input );
 
     if( p_item == NULL )  return NULL;
     p_item->i_children = 0;