schwer-q / xar

Automatically exported from code.google.com/p/xar
0 stars 0 forks source link

xar_extract_tobuffer does not free the returned buffer when an error occured. #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
That's not really an error.
It just would be smarter if xar_extract_tobuffersz() did something like this:

int err = xar_arcmod_extract(x,f,NULL,*buffer,*size);
if (err != 0) {
  *size = 0;
  free(buffer);
  *buffer = NULL;
}
return err;

It would remove the need to to it in each caller.

Original issue reported on code.google.com by jddu...@gmail.com on 16 Oct 2007 at 7:24

GoogleCodeExporter commented 9 years ago
Excellent suggestion, this has been resolved with commit 189.

Original comment by bbraun on 16 Oct 2007 at 7:18