Replace strdup() with pstrdup(), to avoid leaking memory.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 19 May 2011 02:30:24 +0000 (22:30 -0400)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 19 May 2011 02:49:22 +0000 (22:49 -0400)
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

index 8101036cc0e4d2631149a94b3c8ae5f551b0b93a..0a787ff94620241e4596e30c393ab1b142f34f07 100644 (file)
@@ -892,7 +892,7 @@ restore(char *result, float val, int n)
    *p = '\0';
 
    /* get the exponent */
-   strtok(strdup(result), "e");
+   strtok(pstrdup(result), "e");
    exp = atoi(strtok(NULL, "e"));
 
    if (exp == 0)