summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/rpc/svc_simple.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c
index 95d34a6..cf00727 100644
--- a/lib/libc/rpc/svc_simple.c
+++ b/lib/libc/rpc/svc_simple.c
@@ -165,6 +165,10 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)
if (((xdrbuf = malloc((unsigned)recvsz)) == NULL) ||
((netid = strdup(nconf->nc_netid)) == NULL)) {
warnx(rpc_reg_err, rpc_reg_msg, __no_mem_str);
+ if (xdrbuf != NULL)
+ free(xdrbuf);
+ if (netid != NULL)
+ free(netid);
SVC_DESTROY(svcxprt);
break;
}
OpenPOWER on IntegriCloud