Commit e8e468fb authored by Francois Cartegnie's avatar Francois Cartegnie

modules: cache: fix leaking path on error (cid #1048948)

parent f9fcc8bc
......@@ -362,6 +362,7 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
module_cache_t *cache = NULL;
size_t count = 0;
char *path = NULL;
for (;;)
{
......@@ -373,7 +374,6 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
goto error;
}
char *path;
struct stat st;
/* Load common info */
......@@ -385,6 +385,7 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
CacheAdd (&cache, &count, path, &st, module);
free (path);
path = NULL;
/* TODO: deal with errors */
}
......@@ -394,6 +395,7 @@ size_t CacheLoad( vlc_object_t *p_this, const char *dir, module_cache_t **r )
return count;
error:
free( path );
if (ferror (file))
msg_Err(p_this, "plugins cache read error: %s", vlc_strerror_c(errno));
msg_Warn( p_this, "plugins cache not loaded (corrupted)" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment