mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
nwrap: Fix memory leak when getline() is used.
getline() allocates memory even if return code is < 0. Signed-off-by: Robin Hack <hack.robin@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
4505dcd646
commit
9d71542cd9
@ -1705,6 +1705,7 @@ static bool nwrap_parse_file(struct nwrap_cache *nwrap)
|
||||
do {
|
||||
n = getline(&line, &len, nwrap->fp);
|
||||
if (n < 0) {
|
||||
SAFE_FREE(line);
|
||||
if (feof(nwrap->fp)) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user