Fixed use after free
This commit is contained in:
parent
7308465f26
commit
6ce49cd43d
@ -1360,7 +1360,11 @@ static void parse_mods(char* key, void (*action)(void)) {
|
|||||||
mod = NULL;
|
mod = NULL;
|
||||||
}
|
}
|
||||||
struct key_entry* entry = malloc(sizeof(struct key_entry));
|
struct key_entry* entry = malloc(sizeof(struct key_entry));
|
||||||
entry->mod = mod;
|
if(mod == NULL) {
|
||||||
|
entry->mod = NULL;
|
||||||
|
} else {
|
||||||
|
entry->mod = strdup(mod);
|
||||||
|
}
|
||||||
entry->action = action;
|
entry->action = action;
|
||||||
map_put_void(keys, str, entry);
|
map_put_void(keys, str, entry);
|
||||||
} while((str = strtok_r(NULL, ",", &save_ptr)) != NULL);
|
} while((str = strtok_r(NULL, ",", &save_ptr)) != NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user