Author: vlendec
Date: 2006-03-12 17:53:57 +0000 (Sun, 12 Mar 2006)
New Revision: 14247

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14247

Log:
Fix Coverity bug # 136
Modified:
   branches/SAMBA_3_0/source/registry/reg_db.c
   trunk/source/registry/reg_db.c


Changeset:
Modified: branches/SAMBA_3_0/source/registry/reg_db.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_db.c 2006-03-12 17:48:51 UTC (rev 
14246)
+++ branches/SAMBA_3_0/source/registry/reg_db.c 2006-03-12 17:53:57 UTC (rev 
14247)
@@ -525,11 +525,13 @@
        int             len = 0;
        int             i;
        REGISTRY_VALUE  *val;
-       int             num_values = regval_ctr_numvals( values );
+       int             num_values;
 
        if ( !values )
                return 0;
 
+       num_values = regval_ctr_numvals( values );
+
        /* pack the number of values first */
        
        len += tdb_pack( buf+len, buflen-len, "d", num_values );

Modified: trunk/source/registry/reg_db.c
===================================================================
--- trunk/source/registry/reg_db.c      2006-03-12 17:48:51 UTC (rev 14246)
+++ trunk/source/registry/reg_db.c      2006-03-12 17:53:57 UTC (rev 14247)
@@ -525,11 +525,13 @@
        int             len = 0;
        int             i;
        REGISTRY_VALUE  *val;
-       int             num_values = regval_ctr_numvals( values );
+       int             num_values;
 
        if ( !values )
                return 0;
 
+       num_values = regval_ctr_numvals( values );
+
        /* pack the number of values first */
        
        len += tdb_pack( buf+len, buflen-len, "d", num_values );

Reply via email to