ctf_encoder: ctf__encode has to free the buf when compressing

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-04-03 09:25:48 -03:00
parent bd68f6bbc1
commit 4f5e2226de
2 changed files with 5 additions and 1 deletions

View File

@ -552,7 +552,7 @@ int ctf__encode(struct ctf *self, uint8_t flags)
{
struct ctf_header *hdr;
unsigned int size;
void *bf;
void *bf = NULL;
int err = -1;
/* Empty file, nothing to do, so... done! */
@ -757,6 +757,8 @@ out_update:
elf_end(elf);
err = 0;
out_close:
if (bf != self->buf)
free(bf);
close(fd);
return err;
}

View File

@ -22,6 +22,8 @@
#include "dutil.h"
#include "ctf_encoder.h"
#include "alloc_detective.c"
static bool ctf_encode;
static uint8_t class__include_anonymous;