mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
Avoid a potential memleak
Change-Id: I76f30fb40743a989bce25b40238cf0db55bd07e0
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user