VirtualBox

Changeset 18020 in vbox for trunk/src/VBox/Main/cbinding


Ignore:
Timestamp:
Mar 17, 2009 1:09:10 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
44612
Message:

Cbinding: made change to pass libvirt tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/cbinding/VBoxXPCOMCGlue.c

    r17837 r18020  
    3232*   Header Files                                                               *
    3333*******************************************************************************/
    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
    3543#include <stdio.h>
    3644#include <string.h>
     
    3846#include <dlfcn.h>
    3947
     48#include "VBoxXPCOMCGlue.h"
    4049
    4150/*******************************************************************************
     
    8089     */
    8190    cbBuf = cchHome + sizeof("/" DYNLIB_NAME);
    82     pszBuf = (char *)malloc(cbBuf);
     91    if(VIR_ALLOC_N(pszBuf, cbBuf)) {;}
    8392    if (!pszBuf)
    8493    {
     
    128137    else
    129138        sprintf(g_szVBoxErrMsg, "dlopen(%.80s): %128s", pszBuf, dlerror());
    130     free(pszBuf);
     139    VIR_FREE(pszBuf);
    131140    return rc;
    132141}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette