+// SPDX-License-Identifier: GPL-2.0+
/*
* Simple malloc implementation
*
* Copyright (c) 2014 Google, Inc
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
void *ptr;
ptr = malloc(size);
- memset(ptr, '\0', size);
+ if (ptr)
+ memset(ptr, '\0', size);
return ptr;
}