Commit 65b2feb8 authored by Zhao Zhili's avatar Zhao Zhili Committed by Michael Niedermayer

avutil/mem: fix memleak

The original code assumes av_realloc() will free ptr if size is zero.
The assumes is incorrect now.
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d7ae4f79
......@@ -179,7 +179,7 @@ void *av_realloc_f(void *ptr, size_t nelem, size_t elsize)
return NULL;
}
r = av_realloc(ptr, size);
if (!r && size)
if (!r)
av_free(ptr);
return r;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment