vlc_input: handle strdup failure

If the string duplication failed, we don't want to return a
non-identical seekpoint and should prefer to signal that allocation as a
whole failed.
This commit is contained in:
Alexandre Janniaux 2023-08-23 16:26:24 +02:00 committed by Jean-Baptiste Kempf
parent 77ed82a520
commit 0e3741a61f
1 changed files with 7 additions and 0 deletions

View File

@ -77,7 +77,14 @@ static inline seekpoint_t *vlc_seekpoint_Duplicate( const seekpoint_t *src )
return NULL;
if (src->psz_name)
{
point->psz_name = strdup(src->psz_name);
if (point->psz_name == NULL)
{
vlc_seekpoint_Delete(point);
return NULL;
}
}
point->i_time_offset = src->i_time_offset;
return point;
}