git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 168174c)
Replace strdup() with pstrdup(), to avoid leaking memory.
2011年5月19日 02:30:24 +0000 (22:30 -0400)
2011年5月23日 17:59:06 +0000 (20:59 +0300)
It's been like this since the seg module was introduced, so backpatch to
8.2 which is the oldest supported version.


diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c
index 0a6cd025293e3add74267fb62866fbdc81342d7f..9432566abcb88d4784b2984d75f82a2b9a36f2de 100644 (file)
--- a/contrib/seg/seg.c
+++ b/contrib/seg/seg.c
@@ -931,7 +931,7 @@ restore(char *result, float val, int n)
*p = '0円';
/* get the exponent */
- mant = (char *) strtok(strdup(result), "e");
+ mant = (char *) strtok(pstrdup(result), "e");
exp = atoi(strtok(NULL, "e"));
if (exp == 0)
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /