pgcrypto: wrong usage of PG_FREE_IF_COPY

Started by Marko Kreenover 25 years ago2 messagespatches
Jump to latest
#1Marko Kreen
markokr@gmail.com

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);
}

#2Bruce Momjian
bruce@momjian.us
In reply to: Marko Kreen (#1)
Re: pgcrypto: wrong usage of PG_FREE_IF_COPY

Applied.

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);
}

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026