mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-27 23:56:21 +00:00
Removed unnecessary NULL checks when freeing form
This commit is contained in:
@@ -203,13 +203,8 @@ static void
|
|||||||
_free_option(FormOption *option)
|
_free_option(FormOption *option)
|
||||||
{
|
{
|
||||||
if (option != NULL) {
|
if (option != NULL) {
|
||||||
if (option->label != NULL) {
|
free(option->label);
|
||||||
free(option->label);
|
free(option->value);
|
||||||
}
|
|
||||||
if (option->value != NULL) {
|
|
||||||
free(option->value);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(option);
|
free(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -218,25 +213,12 @@ static void
|
|||||||
_free_field(FormField *field)
|
_free_field(FormField *field)
|
||||||
{
|
{
|
||||||
if (field != NULL) {
|
if (field != NULL) {
|
||||||
if (field->label != NULL) {
|
free(field->label);
|
||||||
free(field->label);
|
free(field->type);
|
||||||
}
|
free(field->var);
|
||||||
if (field->type != NULL) {
|
free(field->description);
|
||||||
free(field->type);
|
g_slist_free_full(field->values, free);
|
||||||
}
|
g_slist_free_full(field->options, (GDestroyNotify)_free_option);
|
||||||
if (field->var != NULL) {
|
|
||||||
free(field->var);
|
|
||||||
}
|
|
||||||
if (field->description != NULL) {
|
|
||||||
free(field->description);
|
|
||||||
}
|
|
||||||
if (field->values != NULL) {
|
|
||||||
g_slist_free_full(field->values, free);
|
|
||||||
}
|
|
||||||
if (field->options != NULL) {
|
|
||||||
g_slist_free_full(field->options, (GDestroyNotify)_free_option);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(field);
|
free(field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,20 +227,10 @@ static void
|
|||||||
_form_destroy(DataForm *form)
|
_form_destroy(DataForm *form)
|
||||||
{
|
{
|
||||||
if (form != NULL) {
|
if (form != NULL) {
|
||||||
if (form->type != NULL) {
|
free(form->type);
|
||||||
free(form->type);
|
free(form->title);
|
||||||
}
|
free(form->instructions);
|
||||||
if (form->title != NULL) {
|
g_slist_free_full(form->fields, (GDestroyNotify)_free_field);
|
||||||
free(form->title);
|
|
||||||
}
|
|
||||||
if (form->instructions != NULL) {
|
|
||||||
free(form->instructions);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (form->fields != NULL) {
|
|
||||||
g_slist_free_full(form->fields, (GDestroyNotify)_free_field);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(form);
|
free(form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user