Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur
if the memory wasn't allocated again later on Reported by: Coverity Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
21fddb1173
commit
e830a247a1
@ -452,6 +452,7 @@ set_nameservers(struct ctx *ctx, const char *respath, int ns, ...)
|
||||
free(ctx->ns[i]);
|
||||
}
|
||||
free(ctx->ns);
|
||||
ctx->ns = NULL;
|
||||
}
|
||||
|
||||
fd = open(respath, O_RDWR | O_CREAT | O_NOFOLLOW, 0666);
|
||||
|
Loading…
Reference in New Issue
Block a user