Skip to content

Commit 7541d32

Browse files
committed
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.
1 parent 168174c commit 7541d32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/seg/seg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ restore(char *result, float val, int n)
931931
*p = '\0';
932932

933933
/* get the exponent */
934-
mant = (char *) strtok(strdup(result), "e");
934+
mant = (char *) strtok(pstrdup(result), "e");
935935
exp = atoi(strtok(NULL, "e"));
936936

937937
if (exp == 0)

0 commit comments

Comments
 (0)