On Fri, Jun 22, 2012 at 11:19:10AM +0100, Bastien Nocera wrote:
> On Fri, 2012-06-22 at 16:29 +1000, Peter Hutterer wrote:
> > mkdtemp returns the modified string, but coverity doesn't seem to know that
> > and complains about a leak. So just check for non-null and then carry on as
> > usual, one false positive less.
> > 
> > Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> 
> Reviewed-By: Bastien Nocera <had...@hadess.net>
> 
> > ---
> >  test/dbverify.c |    3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/test/dbverify.c b/test/dbverify.c
> > index 472f4ea..ae6dcb4 100644
> > --- a/test/dbverify.c
> > +++ b/test/dbverify.c
> > @@ -127,8 +127,7 @@ compare_written_database(WacomDeviceDatabase *db)
> >     assert(*devices);
> >  
> >     dirname = strdup("tmp.dbverify.XXXXXX");
> > -   dirname = mkdtemp(dirname);
> > -   assert(dirname);
> > +   assert(mkdtemp(dirname));
> 
> Maybe adding a comment would be useful?


added, thanks.

diff --git a/test/dbverify.c b/test/dbverify.c
index 472f4ea..644bd1b 100644
--- a/test/dbverify.c
+++ b/test/dbverify.c
@@ -127,8 +127,8 @@ compare_written_database(WacomDeviceDatabase *db)
        assert(*devices);

        dirname = strdup("tmp.dbverify.XXXXXX");
-       dirname = mkdtemp(dirname);
-       assert(dirname);
+       assert(mkdtemp(dirname)); /* just check for non-null to avoid
+                                    Coverity complaints */

Cheers,
  Peter


> >  
> >     for (device = devices, i = 0; *device; device++, i++) {
> >             int i;
> 
> 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to