dtcm: Coverity 89081
authorPeter Howkins <flibble@users.sf.net>
Fri, 13 Jul 2018 17:06:36 +0000 (18:06 +0100)
committerPeter Howkins <flibble@users.sf.net>
Fri, 13 Jul 2018 17:06:36 +0000 (18:06 +0100)
cde/programs/dtcm/server/rtable2.c

index 3969ca712da7c7a1ef0019e68244e8294f2c8008..e8b92f3917c6291f7223b6adeecab097ea4298e9 100644 (file)
@@ -347,13 +347,14 @@ _DtCm_register_callback_2_svc(Registration_2 *r, struct svc_req *svcrq)
         static Registration_Status_2 stat;    
         Registration_4 *newreg;       
        Registration_Status_4 *newstat;
-          
-        newreg = _DtCm_reg2_to_reg4(r);      
-        newstat = _DtCm_register_callback_4_svc(newreg, svcrq);      
-                 
-        stat = _DtCm_regstat4_to_regstat2(*newstat);      
-      
-        if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);        
+
+        newreg = _DtCm_reg2_to_reg4(r);
+        if(newreg) {
+                newstat = _DtCm_register_callback_4_svc(newreg, svcrq);
+                stat = _DtCm_regstat4_to_regstat2(*newstat);
+
+                xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
+        }
        return(&stat);
 }