VirtualBox

Changeset 2626 in kBuild for trunk/src/kmk


Ignore:
Timestamp:
Aug 9, 2012 2:11:47 PM (13 years ago)
Author:
bird
Message:

electric.c: the xstrdup() in kObjCache accepts NULL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/electric.c

    r2591 r2626  
    184184xstrdup (const char *ptr)
    185185{
    186   size_t size = strlen (ptr) + 1;
    187   char *result = xmalloc (size);
    188   return memcpy (result, ptr, size);
     186  if (ptr)
     187    {
     188      size_t size = strlen (ptr) + 1;
     189      char *result = xmalloc (size);
     190      return memcpy (result, ptr, size);
     191    }
     192  return NULL;
    189193}
    190194
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