lib9: fix memory leak in dial of regular file (#284)

This commit is contained in:
jvd23 2020-01-13 11:37:48 -05:00 committed by Russ Cox
parent fa7fecff33
commit d96e9e5dc3

View file

@ -141,8 +141,10 @@ Unix:
return -1;
}
/* Allow regular files in addition to Unix sockets. */
if((s = open(unix, ORDWR)) >= 0)
if((s = open(unix, ORDWR)) >= 0){
free(buf);
return s;
}
free(buf);
if((s = socket(ss.ss_family, SOCK_STREAM, 0)) < 0){
werrstr("socket: %r");