summaryrefslogtreecommitdiff
path: root/wk5/pset/inheritance/inheritance.c
diff options
context:
space:
mode:
Diffstat (limited to 'wk5/pset/inheritance/inheritance.c')
-rw-r--r--wk5/pset/inheritance/inheritance.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wk5/pset/inheritance/inheritance.c b/wk5/pset/inheritance/inheritance.c
index 6edb985..36c5cd5 100644
--- a/wk5/pset/inheritance/inheritance.c
+++ b/wk5/pset/inheritance/inheritance.c
@@ -80,9 +80,9 @@ person *create_family(int generations)
void free_family(person *p)
{
// TODO: Handle base case
- if (p->parent[0] == NULL)
+ if (p == NULL)
{
- free(*p);
+ return;
}
// TODO: Free parents recursively