[vlc-commits] services_discovery: don't abort

Thomas Guillem git at videolan.org
Mon Apr 18 15:30:26 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Apr 18 15:27:49 2016 +0200| [6b813e124aed0725b70e6da00f864e2845942be3] | committer: Thomas Guillem

services_discovery: don't abort

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

 src/playlist/services_discovery.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index e413f9b..bf7eb68 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -77,7 +77,13 @@ char **vlc_sd_GetNames (vlc_object_t *obj, char ***pppsz_longnames, int **pp_cat
     int *categories = malloc(sizeof(int) * (count + 1));
 
     if (unlikely (names == NULL || longnames == NULL || categories == NULL))
-        abort();
+    {
+        free(names);
+        free(longnames);
+        free(categories);
+        free(tab);
+        return NULL;
+    }
     for( size_t i = 0; i < count; i++ )
     {
         names[i] = tab[i].name;



More information about the vlc-commits mailing list