diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2009-02-15 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2009-02-15 08:01:00 -0800 |
commit | 0871bffae307e0553e0c5186336189e8b55cf6a6 (patch) | |
tree | 4571d1563fe33a53a57fea1c35fb668b9d33265f /src/base/main/libSupport.c | |
parent | f936cc0680c98ffe51b3a1716c996072d5dbf76c (diff) | |
download | abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2 abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip |
Version abc90215
Diffstat (limited to 'src/base/main/libSupport.c')
-rw-r--r-- | src/base/main/libSupport.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/base/main/libSupport.c b/src/base/main/libSupport.c index 471ea09e..6bffc2bd 100644 --- a/src/base/main/libSupport.c +++ b/src/base/main/libSupport.c @@ -18,9 +18,10 @@ ***********************************************************************/ -#include "mainInt.h" #include <stdio.h> #include <string.h> +#include "mainInt.h" +#include "abc_global.h" #ifndef WIN32 # include <sys/types.h> @@ -50,10 +51,10 @@ void open_libs() { env = getenv ("ABC_LIB_PATH"); if (env == NULL) { // printf("Warning: ABC_LIB_PATH not defined. Looking into the current directory.\n"); - init_p = malloc (2*sizeof(char)); + init_p = ABC_ALLOC( char, (2*sizeof(char)) ); init_p[0]='.'; init_p[1] = 0; } else { - init_p = malloc ((strlen(env)+1)*sizeof(char)); + init_p = ABC_ALLOC( char, ((strlen(env)+1)*sizeof(char)) ); strcpy (init_p, env); } @@ -84,8 +85,8 @@ void open_libs() { // attempt to load it else { - char* szPrefixed = malloc((strlen(dp->d_name) + strlen(p) + 2) * - sizeof(char)); + char* szPrefixed = ABC_ALLOC( char, ((strlen(dp->d_name) + strlen(p) + 2) * + sizeof(char)) ); sprintf(szPrefixed, "%s/", p); strcat(szPrefixed, dp->d_name); libHandles[curr_lib] = dlopen(szPrefixed, RTLD_NOW | RTLD_LOCAL); @@ -98,7 +99,7 @@ void open_libs() { printf("Warning: failed to load ABC library %s:\n\t%s\n", szPrefixed, dlerror()); } - free(szPrefixed); + ABC_FREE(szPrefixed); } } } @@ -106,7 +107,7 @@ void open_libs() { p = endp+1; } - free(init_p); + ABC_FREE(init_p); #endif // null terminate the list of handles |