Skip to content

Commit d22c2c6

Browse files
committed
vo_pp/text: fix CID 480256
a bit formal - the leak occurs when user repeats either t= or f=
1 parent 952a993 commit d22c2c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/vo_postprocess/text.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,15 @@ static void * text_init(const char *config) {
160160
} else if (strstr(item, "h=") != NULL) {
161161
s->req_h = atoi(item + 2);
162162
} else if (strstr(item, "f=") != NULL) {
163+
free(s->req_font);
163164
s->req_font = strdup(strchr(item, '=') + 1);
164165
} else if (strstr(item, "t=") != NULL) {
165166
replace_all(item + 2, DELDEL, ":");
167+
free(s->text);
166168
s->text = strdup(item + 2);
167169
} else {
168170
replace_all(item, DELDEL, ":");
171+
free(s->text);
169172
s->text = strdup(item);
170173
}
171174
tmp = NULL;

0 commit comments

Comments
 (0)