diff options
| author | Nate Straz <nstraz@redhat.com> | 2005-10-18 15:39:26 +0000 |
|---|---|---|
| committer | Nathan Straz <nstraz@redhat.com> | 2008-09-23 09:37:45 -0400 |
| commit | 8b30b78eb2fa41ef7f6f21dc09e3cee96abf8a89 (patch) | |
| tree | 783810563768dd834dcbd5495e6213b96ac140a7 | |
| parent | 88b74ed48b49741a0de7bc11316c89ae58ea2d8d (diff) | |
Fix memory leak in send_packet
| -rw-r--r-- | sockutil.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -110,10 +110,13 @@ send_packet(int fd, struct qa_packet *qp) { char *packetbuf; int packetsize; + ssize_t ret; packetbuf = malloc(1024); memset(packetbuf, 0, 1024); packetbuf = qptostr(qp, &packetbuf, &packetsize); - return write(fd, packetbuf, packetsize); + ret = write(fd, packetbuf, packetsize); + free(packetbuf); + return ret; } |
