projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a7d3110
)
Replace strdup() with pstrdup(), to avoid leaking memory.
author
Heikki Linnakangas
<
[email protected]
>
Thu, 19 May 2011 02:30:24 +0000
(22:30 -0400)
committer
Heikki Linnakangas
<
[email protected]
>
Thu, 19 May 2011 02:36:37 +0000
(22:36 -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
patch
|
blob
|
blame
|
history
diff --git
a/contrib/seg/seg.c
b/contrib/seg/seg.c
index 3354a90094278d0fe5a49d358960057325d5584d..f9b9d93af0f1dd487cb7b1cfcadf9f8047e60db0 100644
(file)
--- a/
contrib/seg/seg.c
+++ b/
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(
p
strdup(result), "e");
exp = atoi(strtok(NULL, "e"));
if (exp == 0)