summaryrefslogtreecommitdiff
path: root/core/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/lexer.c')
-rw-r--r--core/lexer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/lexer.c b/core/lexer.c
index 2eb50a1..e93c629 100644
--- a/core/lexer.c
+++ b/core/lexer.c
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <string.h>
#include "defconf/lexer.h"
+#include "defconf/ptrbox.h"
/* Constants */
#define MAX_KW_LEN 32
@@ -109,7 +110,7 @@ lexer_scan_ident(struct defconf_state *state, int lc)
if (!isalnum(c) && c != '_') {
lexer_putback(state, c);
buf[bufind] = '\0';
- return strdup(buf);
+ return ptrbox_strdup(&state->ptrbox, buf);
}
buf[bufind++] = c;
@@ -177,7 +178,6 @@ lexer_scan(struct defconf_state *state, struct token *result)
/* Scan for an identifier */
if ((ident = lexer_scan_ident(state, c)) != NULL) {
if (lexer_check_kw(ident, result) == 0) {
- free(ident);
return 0;
}