~bl4ckb0ne/boson

f5c04df56e44afa3b564e6433374298860dfe5e1 — Guilherme Janczak 3 days ago 1eebe4d master
interpreter: check return value of calloc
1 files changed, 3 insertions(+), 0 deletions(-)

M src/interpreter.c
M src/interpreter.c => src/interpreter.c +3 -0
@@ 35,6 35,9 @@ eval_string(struct ast_string *string)
	}

	obj->string.data = calloc(string->n, sizeof(char));
	if (!obj->string.data) {
		fatal("failed to allocate string object's data");
	}
	strncpy(obj->string.data, string->data, string->n);
	obj->string.n = string->n;