VirtualBox

Changeset 86374 in vbox for trunk/src/libs/xpcom18a4/ipc


Ignore:
Timestamp:
Oct 1, 2020 12:30:19 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140667
Message:

xpcom/ipcdclient: Fix a few leaks detected running tstMediumLock. bugref:9841

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/client/src/ipcdclient.cpp

    r63754 r86374  
    795795    return rv;
    796796
    797   ipcMessage *msg;
     797  ipcMessage *msg = NULL;
    798798
    799799  // send CLIENT_HELLO and wait for CLIENT_ID response...
    800800  rv = MakeIPCMRequest(new ipcmMessageClientHello(), &msg);
    801801  if (NS_FAILED(rv))
     802  {
     803#ifdef VBOX  /* MakeIPCMRequest may return a failure (e.g. NS_ERROR_CALL_FAILED) and a response msg. */
     804    if (msg)
     805      delete msg;
     806#endif
    802807    return rv;
     808  }
    803809
    804810  if (IPCM_GetType(msg) == IPCM_MSG_ACK_CLIENT_ID)
     
    12251231  NS_ENSURE_TRUE(gClientState, NS_ERROR_NOT_INITIALIZED);
    12261232
    1227   ipcMessage *msg;
     1233  ipcMessage *msg = NULL;
    12281234
    12291235  nsresult rv = MakeIPCMRequest(new ipcmMessageQueryClientByName(aName), &msg);
    12301236  if (NS_FAILED(rv))
     1237  {
     1238#ifdef VBOX  /* MakeIPCMRequest may return a failure (e.g. NS_ERROR_CALL_FAILED) and a response msg. */
     1239    if (msg)
     1240      delete msg;
     1241#endif
    12311242    return rv;
     1243  }
    12321244
    12331245  if (IPCM_GetType(msg) == IPCM_MSG_ACK_CLIENT_ID)
     
    14871499  {
    14881500    NS_WARNING("message target is undefined");
    1489   }
    1490 }
     1501#ifdef VBOX
     1502    delete msg;
     1503#endif
     1504  }
     1505}
Note: See TracChangeset for help on using the changeset viewer.

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