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.
REL8_2_STABLE
Heikki Linnakangas 14 years ago
parent a7d3110638
commit 1f57a2f4dd
  1. 2
      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)

Loading…
Cancel
Save