diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-08 18:36:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-08 18:36:54 +0000 |
commit | fcc21f73c1b7cda850eae13c036c677c9a68f385 (patch) | |
tree | 7ce4444fb7ac9d6f0e1965a0e3742faaa61df3db | |
parent | 864e910166805954dfbfac1980911074efd0d005 (diff) |
use asprintf; ok henning
-rw-r--r-- | usr.sbin/httpd/src/os/unix/os.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/httpd/src/os/unix/os.c b/usr.sbin/httpd/src/os/unix/os.c index 3ee29642c49..341c9ae7c94 100644 --- a/usr.sbin/httpd/src/os/unix/os.c +++ b/usr.sbin/httpd/src/os/unix/os.c @@ -159,16 +159,15 @@ void *ap_os_dso_sym(void *handle, const char *symname) #elif defined(HAVE_DYLD) NSSymbol symbol; - char *symname2 = (char*)malloc(sizeof(char)*(strlen(symname)+2)); - sprintf(symname2, "_%s", symname); + asprintf(&symname2, "_%s", symname); symbol = NSLookupAndBindSymbol(symname2); free(symname2); return NSAddressOfSymbol(symbol); #elif defined(DLSYM_NEEDS_UNDERSCORE) - char *symbol = (char*)malloc(sizeof(char)*(strlen(symname)+2)); + char *symbol; void *retval; - sprintf(symbol, "_%s", symname); + asprintf(&symbol, "_%s", symname); retval = dlsym(handle, symbol); free(symbol); return retval; |