From 202c86ec645b0ec72aa9123dcdd8f735153114ea Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 17 Dec 2009 15:13:56 +0100 Subject: [PATCH] clone_z_type: fix leak; occurred for enc failures --- src/copy_types.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/copy_types.c b/src/copy_types.c index 73519f1..b15536a 100644 --- a/src/copy_types.c +++ b/src/copy_types.c @@ -16,9 +16,7 @@ Z_##x *yaz_clone_z_##x(Z_##x *q, NMEM nmem_out) \ Z_##x *q1 = 0; \ ODR enc = odr_createmem(ODR_ENCODE); \ ODR dec = odr_createmem(ODR_DECODE); \ - if (!z_##x(enc, &q, 0, 0)) \ - return 0; \ - else \ + if (z_##x(enc, &q, 0, 0)) \ { \ int len; \ char *buf = odr_getbuf(enc, &len, 0); \ -- 1.7.10.4