summaryrefslogtreecommitdiff
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:14 -0400
commit4919a20c3331dbecd170387b58075210d6245f51 (patch)
treea3595f7bef1bcdba270618efc82499788dc73952
parent3b65ffa2bf44ea3a1d2b20968a40e72e9fb4687f (diff)
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.
-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)