Clean up many strdups
This commit is contained in:
@@ -34,7 +34,7 @@ struct ucl_object *ucl_state_get(struct ucl_state *state, const char *name) {
|
||||
struct ucl_object *cell = ucl_state_get_cell(state, name);
|
||||
if (cell == NULL) {
|
||||
if (state->parent == NULL) {
|
||||
return ucl_error_create(strdup("Unknown error"));
|
||||
return ucl_error_create("Unknown error");
|
||||
} else {
|
||||
return ucl_state_get(state->parent, name);
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void ucl_state_put(struct ucl_state *state, const char *name, struct ucl_object
|
||||
if (cell == NULL) {
|
||||
ucl_list_append(state->list,
|
||||
ucl_tuple_create(
|
||||
ucl_string_create(strdup(name)),
|
||||
ucl_string_create(name),
|
||||
obj));
|
||||
} else {
|
||||
// TODO: Refcounting / cleanup
|
||||
|
||||
Reference in New Issue
Block a user