Commit 115e403f authored by Daniel Salzman's avatar Daniel Salzman

ypscheme: fix use after free

parent 411538a2
......@@ -204,6 +204,7 @@ int yp_scheme_copy(
int ret = scheme_copy(*dst, src, *dst);
if (ret != KNOT_EOK) {
yp_scheme_free(*dst);
return ret;
}
return KNOT_EOK;
......@@ -234,12 +235,14 @@ int yp_scheme_merge(
int ret = scheme_copy(*dst, src1, *dst);
if (ret != KNOT_EOK) {
yp_scheme_free(*dst);
return ret;
}
// Copy the second scheme.
ret = scheme_copy(*dst + count1, src2, *dst);
if (ret != KNOT_EOK) {
yp_scheme_free(*dst);
return ret;
}
return KNOT_EOK;
......
Markdown is supported
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