[Spice-devel] [usbredir v2] usbredirhost: fix leak on error
Victor Toso
lists at victortoso.com
Thu Aug 4 15:49:59 UTC 2016
Hi,
On Thu, Aug 04, 2016 at 02:33:26PM +0200, Pavel Grunt wrote:
> Ack
Thanks, pushed:
https://cgit.freedesktop.org/spice/usbredir/commit/?id=908686a6e0ba28937532b136
>
> On Thu, 2016-08-04 at 14:15 +0200, Victor Toso wrote:
> > Pointed by coverity:
> > 17. usbredir-0.7.1/usbredirhost/usbredirhost.c:2306: leaked_storage:
> > Returning without freeing "data" leaks the storage that it points to.
> > # 2304|
> > # usbredirhost_bulk_packet_complete(transfer->transfer);
> > # 2305| }
> > # 2306|-> }
> > # 2307|
> > # 2308| static void usbredirhost_iso_packet(void *priv, uint64_t
> > # id,
> > ---
> > usbredirhost/usbredirhost.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
> > index 857e821..a6bf8b3 100644
> > --- a/usbredirhost/usbredirhost.c
> > +++ b/usbredirhost/usbredirhost.c
> > @@ -2280,6 +2280,7 @@ static void usbredirhost_bulk_packet(void *priv,
> > uint64_t id,
> > transfer, BULK_TIMEOUT);
> > #else
> > r = LIBUSB_ERROR_INVALID_PARAM;
> > + free(data);
> > goto error;
> > #endif
> > } else {
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list