Use checked allocation everywhere

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-15 18:47:21 +00:00
parent acb81bc9a9
commit b8912fa749
12 changed files with 74 additions and 62 deletions

View File

@ -8,11 +8,13 @@
#include <stdbool.h>
#include <math.h>
#include "compiler.h"
#include "common.h"
#include "compton.h"
#include "c2.h"
#include "x.h"
#include "string_utils.h"
#include "utils.h"
#include "log.h"
#include "win.h"
@ -813,7 +815,7 @@ bool add_win(session_t *ps, Window id, Window prev) {
}
// Allocate and initialize the new win structure
win *new = malloc(sizeof(win));
auto new = cmalloc(win);
#ifdef DEBUG_EVENTS
printf_dbgf("(%#010lx): %p\n", id, new);