mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix memory leak in mkinitrd(1) AddRulesFromFile error path.
This commit is contained in:
parent
e8a9d3dc04
commit
f744e80b88
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue