Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ea896da

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 1f35944 commit ea896da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/seg/seg.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ restore(char *result, float val, int n)
892892
*p = '\0';
893893

894894
/* get the exponent */
895-
strtok(strdup(result), "e");
895+
strtok(pstrdup(result), "e");
896896
exp = atoi(strtok(NULL, "e"));
897897

898898
if (exp == 0)

0 commit comments

Comments
 (0)