From f6da9f58ab06baee5f0d521f1c64a6982546c560 Mon Sep 17 00:00:00 2001 From: Dean Jansa Date: Fri, 22 Aug 2008 21:04:16 +0000 Subject: Plug some memory leaks --- sockutil.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sockutil.c') diff --git a/sockutil.c b/sockutil.c index db22f67..9394781 100644 --- a/sockutil.c +++ b/sockutil.c @@ -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); -- cgit