summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cc4group.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cc4group.c b/src/cc4group.c
index da1ead4..7f822d9 100644
--- a/src/cc4group.c
+++ b/src/cc4group.c
@@ -3344,17 +3344,17 @@ static char* cc4group_getFullName(const CC4Group* const this)
child = child->parent;
}
+ char* result = NULL;
if(!child->path)
{
- GroupListDestroy(groups);
- return NULL;
+ goto ret;
}
len += strlen(child->path) + 1;
- char* result = malloc(sizeof(char) * len);
+ result = malloc(sizeof(char) * len);
if(result == NULL)
{
- return NULL;
+ goto ret;
}
strcpy(result, child->path);
@@ -3364,6 +3364,8 @@ static char* cc4group_getFullName(const CC4Group* const this)
strcat(result, group->value->pathInParent);
}
+ret:
+ GroupListDestroy(groups);
return result;
}