mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-28 07:51:21 +02:00
libeplayer3: fix invalid free()
according to the man pages.... * dirname() can not return NULL * the pointer returned by dirname must not be free()d * strdup() can return NULL
This commit is contained in:
@@ -291,14 +291,14 @@ static int SsaGetSubtitle(Context_t *context, char * Filename) {
|
||||
|
||||
copyFilename = strdup(Filename);
|
||||
|
||||
FilenameFolder = dirname(copyFilename);
|
||||
|
||||
if (FilenameFolder == NULL)
|
||||
if (copyFilename == NULL)
|
||||
{
|
||||
ssa_err("FilenameFolder NULL\n");
|
||||
ssa_err("copyFilename NULL\n");
|
||||
return cERR_SSA_ERROR;
|
||||
}
|
||||
|
||||
FilenameFolder = dirname(copyFilename);
|
||||
|
||||
ssa_printf(10, "folder: %s\n", FilenameFolder);
|
||||
|
||||
getExtension(copyFilename, &FilenameExtension);
|
||||
@@ -306,7 +306,7 @@ static int SsaGetSubtitle(Context_t *context, char * Filename) {
|
||||
if (FilenameExtension == NULL)
|
||||
{
|
||||
ssa_err("FilenameExtension NULL\n");
|
||||
free(FilenameFolder);
|
||||
free(copyFilename);
|
||||
return cERR_SSA_ERROR;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user