Commit 0a19f355 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

directory: fix memory leak

parent 06402f46
......@@ -393,12 +393,15 @@ int DirRead (access_t *p_access, input_item_node_t *p_current_node)
/* Create an input item for the current entry */
psz_uri = encode_URI_component (psz_entry);
if (psz_uri == NULL
|| asprintf (&psz_full_uri, "%s/%s", p_current->uri, psz_uri) == -1)
|| asprintf (&psz_full_uri, "%s/%s", p_current->uri, psz_uri) == -1)
psz_full_uri = NULL;
free (psz_uri);
if (psz_full_uri == NULL)
{
closedir (handle);
continue;
}
free (psz_uri);
int i_type = i_res == ENTRY_DIR ? ITEM_TYPE_DIRECTORY : ITEM_TYPE_FILE;
p_new = input_item_NewWithType (psz_full_uri, psz_entry,
......
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