Browse Source

avfilter/vf_pullup: fix memleak on error

Fixes CID1108604

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 12 years ago
parent
commit
47eb15b989
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      libavfilter/vf_pullup.c

+ 6
- 2
libavfilter/vf_pullup.c View File

@@ -157,13 +157,17 @@ static PullupField *make_field_queue(PullupContext *s, int len)


for (; len > 0; len--) { for (; len > 0; len--) {
f->next = av_mallocz(sizeof(*f->next)); f->next = av_mallocz(sizeof(*f->next));
if (!f->next)
if (!f->next) {
free_field_queue(head, &f);
return NULL; return NULL;
}


f->next->prev = f; f->next->prev = f;
f = f->next; f = f->next;
if (alloc_metrics(s, f) < 0)
if (alloc_metrics(s, f) < 0) {
free_field_queue(head, &f);
return NULL; return NULL;
}
} }


f->next = head; f->next = head;


Loading…
Cancel
Save