From 4d1f071b024981e1b61038ea771f3ea7e040437a Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sat, 21 Feb 2009 10:24:46 -0500 Subject: [PATCH] Use gcry_... memory functions in do_compress() and do_decompress(). --- src/commands.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/commands.c b/src/commands.c index a730fda4..befb4067 100644 --- a/src/commands.c +++ b/src/commands.c @@ -247,7 +247,7 @@ gboolean do_decompress(assuan_context_t ctx, gpointer in, gint insize, z.next_in = in; z.avail_in = insize; z.avail_out = zlib_bufsize; - z.next_out = pout = g_malloc(zlib_bufsize); + z.next_out = pout = gcry_malloc(zlib_bufsize); if (!pout) { log_write("%s(%i): %s", __FUNCTION__, __LINE__, strerror(ENOMEM)); @@ -259,7 +259,7 @@ gboolean do_decompress(assuan_context_t ctx, gpointer in, gint insize, if (*rc != Z_OK) { log_write("%s(%i): %s", __FUNCTION__, __LINE__, z.msg); - g_free(pout); + gcry_free(pout); return FALSE; } @@ -270,7 +270,7 @@ gboolean do_decompress(assuan_context_t ctx, gpointer in, gint insize, if (*rc != Z_OK) { log_write("%s(%i): %s", __FUNCTION__, __LINE__, z.msg); - g_free(pout); + gcry_free(pout); inflateEnd(&z); return FALSE; } @@ -279,7 +279,7 @@ gboolean do_decompress(assuan_context_t ctx, gpointer in, gint insize, if (*rc != Z_OK) { log_write("%s(%i): %s", __FUNCTION__, __LINE__, z.msg); - g_free(pout); + gcry_free(pout); inflateEnd(&z); return FALSE; } @@ -343,7 +343,7 @@ gboolean do_decompress(assuan_context_t ctx, gpointer in, gint insize, fail: log_write("%s(%i): %s", __FUNCTION__, __LINE__, z.msg); - g_free(pout); + gcry_free(pout); inflateEnd(&z); return FALSE; } @@ -662,7 +662,7 @@ gboolean do_compress(assuan_context_t ctx, gint level, gpointer data, z.next_in = pin = data; z.avail_in = size < zlib_bufsize ? size : zlib_bufsize; z.avail_out = zlib_bufsize; - z.next_out = pout = g_malloc(zlib_bufsize); + z.next_out = pout = gcry_malloc(zlib_bufsize); if (!pout) { log_write("%s(%i): %s", __FUNCTION__, __LINE__, strerror(ENOMEM)); @@ -674,7 +674,7 @@ gboolean do_compress(assuan_context_t ctx, gint level, gpointer data, if (*rc != Z_OK) { log_write("%s(%i): %s", __FUNCTION__, __LINE__, z.msg); - g_free(pout); + gcry_free(pout); return FALSE; } @@ -685,7 +685,7 @@ gboolean do_compress(assuan_context_t ctx, gint level, gpointer data, if (*rc != Z_OK) { log_write("%s(%i): %s", __FUNCTION__, __LINE__, z.msg); - g_free(pout); + gcry_free(pout); deflateEnd(&z); return FALSE; } @@ -756,7 +756,7 @@ gboolean do_compress(assuan_context_t ctx, gint level, gpointer data, fail: log_write("%s(%i): %s", __FUNCTION__, __LINE__, z.msg); - g_free(pout); + gcry_free(pout); deflateEnd(&z); return FALSE; } @@ -1037,7 +1037,7 @@ static gpg_error_t save_command_finalize(assuan_context_t ctx, return send_error(ctx, GPG_ERR_COMPR_ALGO); } else { - gcry_free(xmlbuf); + xmlFree(xmlbuf); xmlbuf = outbuf; len = outsize; } -- 2.11.4.GIT