summaryrefslogtreecommitdiff
path: root/contrib/seg
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:49:22 -0400
commitea896da394cbb0fb32a4b41065ea04b81c4b03f6 (patch)
treeb8f571651e255b4d8f470230acf1c21dd92e3f67 /contrib/seg
parent1f35944607f1ede7dbb1dc3283d955b96f04ea5e (diff)
downloadpostgresql-ea896da394cbb0fb32a4b41065ea04b81c4b03f6.tar.gz
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/seg')
-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 8101036cc0..0a787ff946 100644
--- a/contrib/seg/seg.c
+++ b/contrib/seg/seg.c
@@ -892,7 +892,7 @@ restore(char *result, float val, int n)
*p = '\0';
/* get the exponent */
- strtok(strdup(result), "e");
+ strtok(pstrdup(result), "e");
exp = atoi(strtok(NULL, "e"));
if (exp == 0)