summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sockutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sockutil.c b/sockutil.c
index b84e456..073685e 100644
--- a/sockutil.c
+++ b/sockutil.c
@@ -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;
}