diff options
author | ru <ru@FreeBSD.org> | 2004-01-27 18:38:22 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-01-27 18:38:22 +0000 |
commit | 89536c60f8e7ffb0aebdb264ec4fea8487a97378 (patch) | |
tree | b533107244f9b03c8192fca41b2c98dcbd86b615 /lib | |
parent | 38230899d99297752409d42db82af87b0ac410ce (diff) | |
download | FreeBSD-src-89536c60f8e7ffb0aebdb264ec4fea8487a97378.zip FreeBSD-src-89536c60f8e7ffb0aebdb264ec4fea8487a97378.tar.gz |
Fixed memory leak in NgSendAsciiMsg().
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libnetgraph/msg.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libnetgraph/msg.c b/lib/libnetgraph/msg.c index 927a31a..f89c27f 100644 --- a/lib/libnetgraph/msg.c +++ b/lib/libnetgraph/msg.c @@ -132,8 +132,11 @@ NgSendAsciiMsg(int cs, const char *path, const char *fmt, ...) /* Send node a request to convert ASCII to binary */ if (NgSendMsg(cs, path, NGM_GENERIC_COOKIE, NGM_ASCII2BINARY, - (u_char *)ascii, sizeof(*ascii) + ascii->header.arglen) < 0) + (u_char *)ascii, sizeof(*ascii) + ascii->header.arglen) < 0) { + free(ascii); return (-1); + } + free(ascii); /* Get reply */ if (NgRecvMsg(cs, reply, sizeof(replybuf), NULL) < 0) |