commit 1f9e16fecf97219dfc8439d0ab1b2740095dd56a
parent 0cc44f6f0dfb641edbbc962bc76bf2360ede2d2a
Author: Eyal Sawady <ecs@d2evs.net>
Date: Thu, 24 Dec 2020 18:59:32 -0500
s/malloc/xcalloc/g
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lex.c b/src/lex.c
@@ -484,7 +484,7 @@ lex_string(struct lexer *lexer, struct token *out)
while ((c = next(lexer, NULL, false)) != UTF8_INVALID) {
switch (c) {
case '"':;
- char *buf = malloc(lexer->buflen);
+ char *buf = xcalloc(lexer->buflen, sizeof(char));
memcpy(buf, lexer->buf, lexer->buflen);
out->token = T_LITERAL;
out->storage = TYPE_STORAGE_STRING;