mirror of
https://github.com/gnustep/libs-back.git
synced 2025-06-01 17:52:33 +00:00
Fix memory leaks in convert.c
This commit is contained in:
parent
d9bc28c4ca
commit
3b7f8f0e84
1 changed files with 6 additions and 0 deletions
|
@ -351,6 +351,8 @@ image2TrueColor(RContext *ctx, RImage *image)
|
||||||
if (!err || !nerr) {
|
if (!err || !nerr) {
|
||||||
if (nerr)
|
if (nerr)
|
||||||
free(nerr);
|
free(nerr);
|
||||||
|
if (err)
|
||||||
|
free(err);
|
||||||
RErrorCode = RERR_NOMEMORY;
|
RErrorCode = RERR_NOMEMORY;
|
||||||
RDestroyXImage(ctx, ximg);
|
RDestroyXImage(ctx, ximg);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -522,6 +524,8 @@ image2PseudoColor(RContext *ctx, RImage *image)
|
||||||
if (!err || !nerr) {
|
if (!err || !nerr) {
|
||||||
if (nerr)
|
if (nerr)
|
||||||
free(nerr);
|
free(nerr);
|
||||||
|
if (err)
|
||||||
|
free(err);
|
||||||
RErrorCode = RERR_NOMEMORY;
|
RErrorCode = RERR_NOMEMORY;
|
||||||
RDestroyXImage(ctx, ximg);
|
RDestroyXImage(ctx, ximg);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -757,6 +761,8 @@ image2GrayScale(RContext *ctx, RImage *image)
|
||||||
if (!gerr || !ngerr) {
|
if (!gerr || !ngerr) {
|
||||||
if (ngerr)
|
if (ngerr)
|
||||||
free(ngerr);
|
free(ngerr);
|
||||||
|
if (gerr)
|
||||||
|
free(gerr);
|
||||||
RErrorCode = RERR_NOMEMORY;
|
RErrorCode = RERR_NOMEMORY;
|
||||||
RDestroyXImage(ctx, ximg);
|
RDestroyXImage(ctx, ximg);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue