libauth: fix potential null deref in auth_proxy

Should fix CID 155820
This commit is contained in:
Giacomo Tesio 2017-02-08 00:07:01 +01:00
parent 1f59502bf5
commit 7609abaaf3
1 changed files with 5 additions and 0 deletions

View File

@ -199,6 +199,11 @@ auth_proxy(int fd, AuthGetkey *getkey, char *fmt, ...)
p = vsmprint(fmt, arg);
va_end(arg);
if(p == nil){
werrstr("not enough memory: %r");
return nil;
}
ai = nil;
afd = open("/mnt/factotum/rpc", ORDWR);
if(afd < 0){