Skip site navigation (1) Skip section navigation (2)

pgcrypto: wrong usage of PG_FREE_IF_COPY

From: Marko Kreen <marko(at)l-t(dot)ee>
To: pgsql-patches(at)postgresql(dot)org
Subject: pgcrypto: wrong usage of PG_FREE_IF_COPY
Date: 2001-02-06 16:52:25
Message-ID: 20010206185225.A10330@l-t.ee (view raw or flat)
Thread:
Lists: pgsql-patches
Well, learned the hard way...

-- 
marko


diff -ur contrib/pgcrypto.orig/encode.c contrib/pgcrypto/encode.c
--- contrib/pgcrypto.orig/encode.c	Tue Feb  6 18:45:18 2001
+++ contrib/pgcrypto/encode.c	Tue Feb  6 18:45:48 2001
@@ -79,7 +79,7 @@
 		elog(FATAL, "pg_encode: overflow, encode estimate too small");
 	
 	PG_FREE_IF_COPY(arg, 0);
-	PG_FREE_IF_COPY(name, 0);
+	PG_FREE_IF_COPY(name, 1);
 	
 	PG_RETURN_TEXT_P(res);
 }
@@ -116,7 +116,7 @@
 		elog(FATAL, "pg_decode: overflow, decode estimate too small");
 	
 	PG_FREE_IF_COPY(arg, 0);
-	PG_FREE_IF_COPY(name, 0);
+	PG_FREE_IF_COPY(name, 1);
 	
 	PG_RETURN_TEXT_P(res);
 }
diff -ur contrib/pgcrypto.orig/pgcrypto.c contrib/pgcrypto/pgcrypto.c
--- contrib/pgcrypto.orig/pgcrypto.c	Tue Feb  6 18:45:18 2001
+++ contrib/pgcrypto/pgcrypto.c	Tue Feb  6 18:46:00 2001
@@ -80,7 +80,7 @@
 	h->digest(h, VARDATA(arg), len, VARDATA(res));
 	
 	PG_FREE_IF_COPY(arg, 0);
-	PG_FREE_IF_COPY(name, 0);
+	PG_FREE_IF_COPY(name, 1);
 	
 	PG_RETURN_TEXT_P(res);
 }

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2001-02-06 17:45:27
Subject: Re: Re: [PATCHES] A Sparc/Linux patch (for 7.1), and a Linux rc.d/init.d script....
Previous:From: Ryan KirkpatrickDate: 2001-02-06 04:59:13
Subject: Re: [PATCHES] A Sparc/Linux patch (for 7.1), and a Linux rc.d/init.d script....

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group