Fixed possible memory leak.

This commit is contained in:
Armin Novak 2015-09-01 12:34:40 +02:00
parent 97f7aa8f42
commit 61e7f993aa

View File

@ -410,18 +410,9 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr)
/* copy hotpluged device mount point to the dev_array */
if (strstr(word, "/mnt/") != NULL || strstr(word, "/media/") != NULL)
{
dev_array[size].path = _strdup(word);
if (!dev_array[size].path)
{
fclose(f);
free(line);
error = CHANNEL_RC_NO_MEMORY;
goto cleanup;
}
dev_array[size].path = word;
dev_array[size++].to_add = TRUE;
}
free(word);
}
free(line);
}