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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy