Skip to content

Commit

Permalink
Use checked allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
cgzones committed Jan 9, 2024
1 parent 9b660eb commit bb04fe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ void mark_userspace_class(const char *class_name)
HASH_FIND(hh_userspace_class, userspace_class_map, class_name, strlen(class_name), userspace_class);

if (!userspace_class) {
userspace_class = malloc(sizeof(struct bool_hash_elem));
userspace_class->key = strdup(class_name);
userspace_class = xmalloc(sizeof(struct bool_hash_elem));
userspace_class->key = xstrdup(class_name);
userspace_class->val = 1;
HASH_ADD_KEYPTR(hh_userspace_class, userspace_class_map, userspace_class->key,
strlen(userspace_class->key), userspace_class);
Expand Down

0 comments on commit bb04fe6

Please sign in to comment.