vlc | branch: master | Alexandre Janniaux <[email protected]> | Tue Nov 26 
15:17:19 2019 +0100| [474a8c907cb826396d011d77a1c0dca53c59fe82] | committer: 
Thomas Guillem

modules/bank: refactor strdup error

Signed-off-by: Thomas Guillem <[email protected]>

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

 src/modules/bank.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/modules/bank.c b/src/modules/bank.c
index 275680456b..36c4b30cdd 100644
--- a/src/modules/bank.c
+++ b/src/modules/bank.c
@@ -321,14 +321,19 @@ static int AllocatePluginFile (module_bank_t *bank, const 
char *abspath,
 
     if (plugin == NULL)
     {
+        char *path = strdup(relpath);
+        if (path == NULL)
+            return -1;
+
         plugin = module_InitDynamic(bank->obj, abspath, true);
 
         if (plugin != NULL)
         {
-            plugin->path = xstrdup(relpath);
+            plugin->path = path;
             plugin->mtime = st->st_mtime;
             plugin->size = st->st_size;
         }
+        else free(path);
     }
 
     if (plugin == NULL)

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to