Pedro Alves wrote: > On Sunday 27 February 2011 00:30:38, Michael Snyder wrote: >> Found by coverity. > > Do you try running coverity on your patches? > >> @@ -367,6 +367,7 @@ handle_pwrite (char *own_buf, int packet >> || require_data (p, packet_len - (p - own_buf), &data, &len)) >> { >> hostio_packet_error (own_buf); >> + free (data); >> return; >> } > > This is wrong. If any predicate other than require_data in if above > returned true, then you'll be freeing a garbage pointer. I'd > fix this in require_data ... just free the output buffer when > returning error, so the callers never have to. Like this?