diff options
author | Peter Eisentraut | 2013-10-13 04:09:18 +0000 |
---|---|---|
committer | Peter Eisentraut | 2013-10-13 04:09:18 +0000 |
commit | 5b6d08cd2992922b667564a49f19580f11676050 (patch) | |
tree | 4104a4255eeb88e78da71477b5f7b129f9a1b599 /contrib/spi/refint.c | |
parent | a53dee43fe585e673658b01e7354892dcede957e (diff) |
Add use of asprintf()
Add asprintf(), pg_asprintf(), and psprintf() to simplify string
allocation and composition. Replacement implementations taken from
NetBSD.
Reviewed-by: Álvaro Herrera <alvherre@2ndquadrant.com>
Reviewed-by: Asif Naeem <anaeem.it@gmail.com>
Diffstat (limited to 'contrib/spi/refint.c')
-rw-r--r-- | contrib/spi/refint.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c index 8dc565a1907..fbed3003961 100644 --- a/contrib/spi/refint.c +++ b/contrib/spi/refint.c @@ -634,8 +634,7 @@ find_plan(char *ident, EPlan **eplan, int *nplans) (*nplans) = i = 0; } - newp->ident = (char *) malloc(strlen(ident) + 1); - strcpy(newp->ident, ident); + newp->ident = strdup(ident); newp->nplans = 0; newp->splan = NULL; (*nplans)++; |