From 5d1923b424252e0ff2921ddaf0ce80cc73ef5560 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 18 May 2011 22:30:24 -0400 Subject: [PATCH] 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. --- contrib/seg/seg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c index 0a6cd02529..9432566abc 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) -- 2.50.1