summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2008-10-20 21:14:47 +0000
committerGreg Hudson <ghudson@mit.edu>2008-10-20 21:14:47 +0000
commitae423f53214830de1367627180031283de998746 (patch)
treef3268a5a9d718d570883bf296c52c117e0dfc709 /src/plugins
parentcdea7397975a960e3c02479f8aa4ede0bc349105 (diff)
downloadkrb5-ae423f53214830de1367627180031283de998746.tar.gz
krb5-ae423f53214830de1367627180031283de998746.tar.xz
krb5-ae423f53214830de1367627180031283de998746.zip
Use asprintf instead of malloc/strcpy/strcat in many places
ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20901 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/kdb/db2/kdb_db2.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c
index 0aa3c4fd8..1e67ea034 100644
--- a/src/plugins/kdb/db2/kdb_db2.c
+++ b/src/plugins/kdb/db2/kdb_db2.c
@@ -219,11 +219,8 @@ gen_dbsuffix(char *db_name, char *sfx)
if (sfx == NULL)
return ((char *) NULL);
- dbsuffix = malloc(strlen(db_name) + strlen(sfx) + 1);
- if (!dbsuffix)
+ if (asprintf(&dbsuffix, "%s%s", db_name, sfx) < 0)
return (0);
- (void) strcpy(dbsuffix, db_name);
- (void) strcat(dbsuffix, sfx);
return dbsuffix;
}