Commit f744e80b authored by Jonas Termansen's avatar Jonas Termansen

Fix memory leak in mkinitrd(1) AddRulesFromFile error path.

parent e8a9d3dc
......@@ -225,15 +225,16 @@ bool AddRulesFromFile(FILE* fp, const char* fpname)
goto error_out;
}
}
free(mem);
if ( ferror(fp) )
{
error_out_errno:
warn("%s", fpname);
error_out:
free(mem);
ChangeRulesAmount(rules_at_start);
return false;
}
free(mem);
return true;
}
......
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