VirtualBox

Changeset 44218 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Dec 31, 2012 12:28:59 PM (12 years ago)
Author:
vboxsync
Message:

Runtime/manifest.cpp: Fix a possible NULL pointer dereference in the error case (found by clang-analyzer)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/checksum/manifest.cpp

    r41170 r44218  
    253253    if (pvBuf)
    254254        RTMemFree(pvBuf);
    255     for (size_t i = 0; i < cFiles; ++i)
    256         if (paFiles[i].pszTestDigest)
    257             RTStrFree((char*)paFiles[i].pszTestDigest);
    258     RTMemFree(paFiles);
     255    if (paFiles)
     256    {
     257        for (size_t i = 0; i < cFiles; ++i)
     258            if (paFiles[i].pszTestDigest)
     259                RTStrFree((char*)paFiles[i].pszTestDigest);
     260        RTMemFree(paFiles);
     261    }
    259262
    260263    /* Delete the manifest file on failure */
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