Skip to content

Commit e760b64

Browse files
Psilokostguillem
authored andcommitted
vout: remove xmalloc
Signed-off-by: Thomas Guillem <[email protected]>
1 parent 73e1d17 commit e760b64

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/video_output/video_output.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -714,14 +714,22 @@ static void ThreadChangeFilters(vout_thread_t *vout,
714714
char *next = config_ChainCreate(&name, &cfg, current);
715715

716716
if (name && *name) {
717-
vout_filter_t *e = xmalloc(sizeof(*e));
718-
e->name = name;
719-
e->cfg = cfg;
720-
if (!strcmp(e->name, "deinterlace") ||
721-
!strcmp(e->name, "postproc")) {
722-
vlc_array_append(&array_static, e);
723-
} else {
724-
vlc_array_append(&array_interactive, e);
717+
vout_filter_t *e = malloc(sizeof(*e));
718+
719+
if (e) {
720+
e->name = name;
721+
e->cfg = cfg;
722+
if (!strcmp(e->name, "deinterlace") ||
723+
!strcmp(e->name, "postproc")) {
724+
vlc_array_append(&array_static, e);
725+
} else {
726+
vlc_array_append(&array_interactive, e);
727+
}
728+
}
729+
else {
730+
if (cfg)
731+
config_ChainDestroy(cfg);
732+
free(name);
725733
}
726734
} else {
727735
if (cfg)

0 commit comments

Comments
 (0)