diff options
-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; } |