diff options
author | Dean Jansa <djansa@redhat.com> | 2008-08-22 21:04:16 +0000 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2008-09-23 09:37:47 -0400 |
commit | f6da9f58ab06baee5f0d521f1c64a6982546c560 (patch) | |
tree | 21f0184599d156b68aa800d2889f204b3baafad9 /sockutil.c | |
parent | 54cc78586aec14c714060c2d64837cfe54fdc9eb (diff) | |
download | qarsh-f6da9f58ab06baee5f0d521f1c64a6982546c560.tar.gz qarsh-f6da9f58ab06baee5f0d521f1c64a6982546c560.tar.xz qarsh-f6da9f58ab06baee5f0d521f1c64a6982546c560.zip |
Plug some memory leaks
Diffstat (limited to 'sockutil.c')
-rw-r--r-- | sockutil.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1,5 +1,5 @@ /* - * Copyright © 2005,2006 Red Hat, Inc. All rights reserved. + * Copyright © 2005,20068 Red Hat, Inc. All rights reserved. * * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions of the @@ -143,9 +143,7 @@ send_packet(int fd, struct qa_packet *qp) char *packetbuf; int packetsize; ssize_t ret; - - packetbuf = malloc(QARSH_MAX_PACKET_SIZE); - memset(packetbuf, 0, QARSH_MAX_PACKET_SIZE); + packetbuf = qptostr(qp, &packetbuf, &packetsize); ret = write(fd, packetbuf, packetsize); |