Commit b923260d authored by Moritz Grimm's avatar Moritz Grimm
Browse files

mdata_destroy() is supposed to be idempotent

parent 3d83b1ba
...@@ -277,6 +277,7 @@ mdata_destroy(struct mdata **md_p) ...@@ -277,6 +277,7 @@ mdata_destroy(struct mdata **md_p)
{ {
struct mdata *md = *md_p; struct mdata *md = *md_p;
if (md)
_mdata_clear(md); _mdata_clear(md);
xfree(md); xfree(md);
*md_p = NULL; *md_p = NULL;
......
...@@ -193,6 +193,7 @@ setup_checked(void) ...@@ -193,6 +193,7 @@ setup_checked(void)
void void
teardown_checked(void) teardown_checked(void)
{ {
mdata_destroy(&md);
mdata_destroy(&md); mdata_destroy(&md);
ck_assert_ptr_eq(md, NULL); ck_assert_ptr_eq(md, NULL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment