From: Frank Mori Hess Date: Wed, 19 Oct 2005 02:38:01 +0000 (+0000) Subject: Fix memory leak noted by "Michael Brooks" X-Git-Tag: r0_7_71~130 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c4194bb70ada4d7efa7b056d2c0b945494c3ee57;p=comedi.git Fix memory leak noted by "Michael Brooks" --- diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 8db0b10d..83cf1e86 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -893,11 +893,10 @@ static int do_cmd_ioctl(comedi_device *dev,void *arg,void *file) } async->cmd=user_cmd; - async->cmd.chanlist=NULL; async->cmd.data=NULL; /* load channel/gain list */ - /* we should have this already allocated */ + if(async->cmd.chanlist) kfree(async->cmd.chanlist); async->cmd.chanlist=kmalloc(async->cmd.chanlist_len*sizeof(int),GFP_KERNEL); if(!async->cmd.chanlist){ DPRINTK("allocation failed\n");