mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
Avoid a potential memleak
Change-Id: I76f30fb40743a989bce25b40238cf0db55bd07e0
This commit is contained in:
parent
3ebe175781
commit
e89c6fc867
@ -77,7 +77,10 @@ WebPFrameCache* WebPFrameCacheNew(size_t kmin, size_t kmax) {
|
||||
cache->size = kmax - kmin;
|
||||
cache->encoded_frames =
|
||||
(EncodedFrame*)calloc(cache->size, sizeof(*cache->encoded_frames));
|
||||
if (cache->encoded_frames == NULL) return 0;
|
||||
if (cache->encoded_frames == NULL) {
|
||||
free(cache);
|
||||
return NULL;
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user