[vlc-commits] cli: drop item if option alloc fails
Rémi Denis-Courmont
git at videolan.org
Sat Nov 21 15:51:31 CET 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 21 11:27:04 2020 +0200| [66e13864523c8afd3a3beb47ccbcf31daf8943bd] | committer: Rémi Denis-Courmont
cli: drop item if option alloc fails
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=66e13864523c8afd3a3beb47ccbcf31daf8943bd
---
modules/control/cli/playlist.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/control/cli/playlist.c b/modules/control/cli/playlist.c
index 6fa7a52438..5f31c5aeac 100644
--- a/modules/control/cli/playlist.c
+++ b/modules/control/cli/playlist.c
@@ -383,9 +383,13 @@ static void PlaylistAddCommon(intf_thread_t *intf, const char *const *args,
*/
while (i < n_args && args[i][0] == ':')
{
- if (likely(item != NULL))
- input_item_AddOption(item, args[i] + 1,
- VLC_INPUT_OPTION_TRUSTED);
+ if (likely(item != NULL)
+ && input_item_AddOption(item, args[i] + 1,
+ VLC_INPUT_OPTION_TRUSTED))
+ {
+ input_item_Release(item);
+ item = NULL;
+ }
i++;
}
More information about the vlc-commits
mailing list