Changeset 18020 in vbox for trunk/src/VBox/Main/cbinding
- Timestamp:
- Mar 17, 2009 1:09:10 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 44612
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/VBoxXPCOMCGlue.c
r17837 r18020 32 32 * Header Files * 33 33 *******************************************************************************/ 34 #include "VBoxXPCOMCGlue.h" 34 35 #ifdef VBOX_WITH_XPCOM 36 # define VIR_ALLOC_N(a, b) ((a) = (char *)malloc(b)) 37 # define VIR_FREE(name) (free(name)) 38 #else /* !VBOX_WITH_XPCOM */ 39 # include <config.h> 40 # include "memory.h" 41 #endif /* !VBOX_WITH_XPCOM */ 42 35 43 #include <stdio.h> 36 44 #include <string.h> … … 38 46 #include <dlfcn.h> 39 47 48 #include "VBoxXPCOMCGlue.h" 40 49 41 50 /******************************************************************************* … … 80 89 */ 81 90 cbBuf = cchHome + sizeof("/" DYNLIB_NAME); 82 pszBuf = (char *)malloc(cbBuf);91 if(VIR_ALLOC_N(pszBuf, cbBuf)) {;} 83 92 if (!pszBuf) 84 93 { … … 128 137 else 129 138 sprintf(g_szVBoxErrMsg, "dlopen(%.80s): %128s", pszBuf, dlerror()); 130 free(pszBuf);139 VIR_FREE(pszBuf); 131 140 return rc; 132 141 }
Note:
See TracChangeset
for help on using the changeset viewer.