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-23 20:59:06 +0300
commit7541d32e86b739afb41e711a4c790aed446dd0e2 (patch)
tree31a2fb94afe242c769de8d83de8fa1ee314b8fb9
parent168174c44522b5f5bfad53500fd5dd46aad74f70 (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 0a6cd025293..9432566abcb 100644
--- a/contrib/seg/seg.c
+++ b/contrib/seg/seg.c
@@ -931,7 +931,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)