postgres.git / summary / log / commit / refs

commit    1f57a2f4dd2f6033e28b0e1f04ef31d5f456793c
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Thu May 19 02:30:24 2011 +0000

    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 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) [parent: a7d3110638bd]