aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-05-18 22:30:24 -0400
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-05-18 22:36:37 -0400
commit1f57a2f4dd2f6033e28b0e1f04ef31d5f456793c (patch)
treef62da3e187ce961da14ada16ca4b082ed8b3dffd /contrib
parenta7d3110638bd9b8951c11913621e86ac79db1a1f (diff)
downloadpostgresql-1f57a2f4dd2f6033e28b0e1f04ef31d5f456793c.tar.gz
postgresql-1f57a2f4dd2f6033e28b0e1f04ef31d5f456793c.zip
Replace strdup() with pstrdup(), to avoid leaking memory.
It's been like this since the seg module was introduced, so backpatch to 8.2 which is the oldest supported version.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/seg/seg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c
index 3354a900942..f9b9d93af0f 100644
--- a/contrib/seg/seg.c
+++ b/contrib/seg/seg.c
@@ -929,7 +929,7 @@ restore(char *result, float val, int n)
*p = '\0';
/* get the exponent */
- mant = (char *) strtok(strdup(result), "e");
+ mant = (char *) strtok(pstrdup(result), "e");
exp = atoi(strtok(NULL, "e"));
if (exp == 0)