Skip to content
Snippets Groups Projects
Commit 342a30dd authored by Mirar (Pontus Hagland)'s avatar Mirar (Pontus Hagland)
Browse files

memory leak in scale() fixed (the new scale)

Rev: src/modules/image/matrix.c:1.7
parent 01f854a7
Branches
Tags
No related merge requests found
/* $Id: matrix.c,v 1.6 1996/12/01 00:01:15 law Exp $ */ /* $Id: matrix.c,v 1.7 1996/12/03 22:40:46 law Exp $ */
#include "global.h" #include "global.h"
...@@ -188,7 +188,7 @@ CHRONO("scale begin"); ...@@ -188,7 +188,7 @@ CHRONO("scale begin");
} }
dest->img=d=malloc(newx*newy*sizeof(rgb_group) +1); dest->img=d=malloc(newx*newy*sizeof(rgb_group) +1);
if (!d) error("Out of memory!\n"); if (!d) { free(new); error("Out of memory!\n"); }
CHRONO("transfer begin"); CHRONO("transfer begin");
...@@ -205,6 +205,8 @@ CHRONO("transfer begin"); ...@@ -205,6 +205,8 @@ CHRONO("transfer begin");
dest->xsize=newx; dest->xsize=newx;
dest->ysize=newy; dest->ysize=newy;
free(new);
CHRONO("scale end"); CHRONO("scale end");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment