mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 01:16:21 +00:00
Clean up keys after using parse_options
This commit is contained in:
@@ -93,6 +93,7 @@ cmd_connect(gchar **args, struct cmd_help_t help)
|
|||||||
}
|
}
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(opt_keys);
|
||||||
|
|
||||||
char *user = args[0];
|
char *user = args[0];
|
||||||
char *lower = g_utf8_strdown(user, -1);
|
char *lower = g_utf8_strdown(user, -1);
|
||||||
@@ -1587,6 +1588,7 @@ cmd_join(gchar **args, struct cmd_help_t help)
|
|||||||
passwd = g_hash_table_lookup(options, "password");
|
passwd = g_hash_table_lookup(options, "password");
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(opt_keys);
|
||||||
|
|
||||||
// In the case that a nick wasn't provided by the optional args...
|
// In the case that a nick wasn't provided by the optional args...
|
||||||
if (nick == NULL) {
|
if (nick == NULL) {
|
||||||
|
|||||||
@@ -521,6 +521,7 @@ parse_options_when_none_returns_empty_hasmap(void **state)
|
|||||||
assert_true(res);
|
assert_true(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -539,6 +540,7 @@ parse_options_when_opt1_no_val_sets_error(void **state)
|
|||||||
assert_false(res);
|
assert_false(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -559,6 +561,7 @@ parse_options_when_one_returns_map(void **state)
|
|||||||
assert_true(res);
|
assert_true(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -578,6 +581,7 @@ parse_options_when_opt2_no_val_sets_error(void **state)
|
|||||||
assert_false(res);
|
assert_false(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -601,6 +605,7 @@ parse_options_when_two_returns_map(void **state)
|
|||||||
assert_true(res);
|
assert_true(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -621,6 +626,7 @@ parse_options_when_opt3_no_val_sets_error(void **state)
|
|||||||
assert_false(res);
|
assert_false(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -647,6 +653,7 @@ parse_options_when_three_returns_map(void **state)
|
|||||||
assert_true(res);
|
assert_true(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -667,6 +674,7 @@ parse_options_when_unknown_opt_sets_error(void **state)
|
|||||||
assert_false(res);
|
assert_false(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -687,4 +695,5 @@ parse_options_with_duplicated_option_sets_error(void **state)
|
|||||||
assert_false(res);
|
assert_false(res);
|
||||||
|
|
||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
g_list_free(keys);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user