diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-11-27 23:10:46 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2010-12-07 11:10:35 -0800 |
commit | d2c42b102707db6c1ca9dccc4de9210a43650cb1 (patch) | |
tree | 3283795b8b612cf43aa43fd7c8a7c19ab0c995fb /hw/xfree86/loader | |
parent | 3a9bb93dd178084f4ff1abcea331ca5a62f88ce6 (diff) |
Replace alloc+strcpy+strcat with asprintf() & XNFasprintf() calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Diffstat (limited to 'hw/xfree86/loader')
-rw-r--r-- | hw/xfree86/loader/loadmod.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index 1f6933a3b..3b3511cd1 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -933,16 +933,14 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, * now check if the special data object <modulename>ModuleData is * present. */ - p = malloc(strlen(name) + strlen("ModuleData") + 1); - if (!p) { + if (asprintf(&p, "%sModuleData", name) == -1) { + p = NULL; if (errmaj) *errmaj = LDR_NOMEM; if (errmin) *errmin = 0; goto LoadModule_fail; } - strcpy(p, name); - strcat(p, "ModuleData"); initdata = LoaderSymbol(p); if (initdata) { ModuleSetupProc setup; |