mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-16 12:28:11 +00:00
[client/common] fixes for issues detected through static analysis.
This commit is contained in:
@@ -216,6 +216,12 @@ GraphHandle overlayGraph_register(const char * name, RingBuffer buffer,
|
||||
float min, float max, GraphFormatFn formatFn)
|
||||
{
|
||||
struct OverlayGraph * graph = malloc(sizeof(*graph));
|
||||
if (!graph)
|
||||
{
|
||||
DEBUG_ERROR("out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
graph->name = name;
|
||||
graph->buffer = buffer;
|
||||
graph->enabled = true;
|
||||
|
@@ -152,6 +152,12 @@ MsgBoxHandle overlayMsg_show(
|
||||
const char * caption, const char * fmt, va_list args)
|
||||
{
|
||||
struct Msg * msg = malloc(sizeof(*msg));
|
||||
if (!msg)
|
||||
{
|
||||
DEBUG_ERROR("out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
msg->caption = strdup(caption);
|
||||
msg->lines = stringlist_new(false);
|
||||
valloc_sprintf(&msg->message, fmt, args);
|
||||
|
Reference in New Issue
Block a user