mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +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:
@@ -290,14 +290,14 @@ static int SrtGetSubtitle(Context_t *context, char * Filename) {
|
||||
|
||||
copyFilename = strdup(Filename);
|
||||
|
||||
FilenameFolder = dirname(copyFilename);
|
||||
|
||||
if (FilenameFolder == NULL)
|
||||
if (copyFilename == NULL)
|
||||
{
|
||||
srt_err("FilenameFolder NULL\n");
|
||||
srt_err("copyFilename NULL\n");
|
||||
return cERR_SRT_ERROR;
|
||||
}
|
||||
|
||||
FilenameFolder = dirname(copyFilename);
|
||||
|
||||
srt_printf(10, "folder: %s\n", FilenameFolder);
|
||||
|
||||
getExtension(copyFilename, &FilenameExtension);
|
||||
@@ -305,7 +305,7 @@ static int SrtGetSubtitle(Context_t *context, char * Filename) {
|
||||
if (FilenameExtension == NULL)
|
||||
{
|
||||
srt_err("FilenameExtension NULL\n");
|
||||
free(FilenameFolder);
|
||||
free(copyFilename);
|
||||
return cERR_SRT_ERROR;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user