Skip to content
Snippets Groups Projects
Commit 2bb2225b authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Fixed a few memory leaks.

Rev: src/modules/Gz/zlibmod.c:1.27
parent 2228d5c3
Branches
Tags
No related merge requests found
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
||| Pike is distributed as GPL (General Public License) ||| Pike is distributed as GPL (General Public License)
||| See the files COPYING and DISCLAIMER for more information. ||| See the files COPYING and DISCLAIMER for more information.
\*/ \*/
/**/
#include "global.h" #include "global.h"
RCSID("$Id: zlibmod.c,v 1.26 1999/07/15 16:58:44 hubbe Exp $"); RCSID("$Id: zlibmod.c,v 1.27 1999/08/20 20:04:31 grubba Exp $");
#include "zlib_machine.h" #include "zlib_machine.h"
...@@ -135,8 +136,6 @@ static void gz_deflate(INT32 args) ...@@ -135,8 +136,6 @@ static void gz_deflate(INT32 args)
if(!THIS->gz.state) if(!THIS->gz.state)
error("gz_deflate not initialized or destructed\n"); error("gz_deflate not initialized or destructed\n");
initialize_buf(&buf);
if(args<1) if(args<1)
error("Too few arguments to gz_deflate->deflate()\n"); error("Too few arguments to gz_deflate->deflate()\n");
...@@ -170,6 +169,8 @@ static void gz_deflate(INT32 args) ...@@ -170,6 +169,8 @@ static void gz_deflate(INT32 args)
this->gz.next_in=(Bytef *)data->str; this->gz.next_in=(Bytef *)data->str;
this->gz.avail_in=data->len; this->gz.avail_in=data->len;
initialize_buf(&buf);
fail=do_deflate(&buf,this,flush); fail=do_deflate(&buf,this,flush);
pop_n_elems(args); pop_n_elems(args);
...@@ -287,8 +288,6 @@ static void gz_inflate(INT32 args) ...@@ -287,8 +288,6 @@ static void gz_inflate(INT32 args)
if(!THIS->gz.state) if(!THIS->gz.state)
error("gz_inflate not initialized or destructed\n"); error("gz_inflate not initialized or destructed\n");
initialize_buf(&buf);
if(args<1) if(args<1)
error("Too few arguments to gz_inflate->inflate()\n"); error("Too few arguments to gz_inflate->inflate()\n");
...@@ -300,6 +299,8 @@ static void gz_inflate(INT32 args) ...@@ -300,6 +299,8 @@ static void gz_inflate(INT32 args)
this->gz.next_in=(Bytef *)data->str; this->gz.next_in=(Bytef *)data->str;
this->gz.avail_in=data->len; this->gz.avail_in=data->len;
initialize_buf(&buf);
fail=do_inflate(&buf,this,Z_PARTIAL_FLUSH); fail=do_inflate(&buf,this,Z_PARTIAL_FLUSH);
pop_n_elems(args); pop_n_elems(args);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment