git.samba.org
/
nivanova
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4505dcd
)
nwrap: Fix memory leak when getline() is used.
author
Robin Hack
<hack.robin@gmail.com>
Thu, 8 Oct 2015 09:36:33 +0000
(11:36 +0200)
committer
Michael Adam
<obnox@samba.org>
Mon, 11 Jan 2016 11:25:28 +0000
(12:25 +0100)
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>
lib/nss_wrapper/nss_wrapper.c
patch
|
blob
|
history
diff --git
a/lib/nss_wrapper/nss_wrapper.c
b/lib/nss_wrapper/nss_wrapper.c
index bf51ec2d89696eff575be21e9a1842ae205b814b..2759cd7a472c24fe4f92142e92d04448d7d120ae 100644
(file)
--- a/
lib/nss_wrapper/nss_wrapper.c
+++ b/
lib/nss_wrapper/nss_wrapper.c
@@
-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;
}