summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-10-31 11:21:38 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-10-31 11:21:38 -0400
commite742dcc9ed4b22eb5191f7e8d2b7cd8011ed5893 (patch)
treec7a51f586a7e44a67b3b4d7ef925e2b1b84f9c13
parent3f1063f92aa60cf93bca6a6b15a7f782b8df8f93 (diff)
scanner: Check name == NULL for enum entries
From a clang static analysis warning.
-rw-r--r--src/scanner.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/scanner.c b/src/scanner.c
index 07d1edf..5f85396 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -267,6 +267,9 @@ start_element(void *data, const char *element_name, const char **atts)
ctx->enumeration = enumeration;
} else if (strcmp(element_name, "entry") == 0) {
+ if (name == NULL)
+ fail(ctx, "no entry name given");
+
entry = malloc(sizeof *entry);
entry->name = strdup(name);
entry->uppercase_name = uppercase_dup(name);