dtcm: Coverity 89517
authorPeter Howkins <flibble@users.sf.net>
Fri, 13 Jul 2018 17:42:56 +0000 (18:42 +0100)
committerPeter Howkins <flibble@users.sf.net>
Fri, 13 Jul 2018 17:42:56 +0000 (18:42 +0100)
cde/programs/dtcm/server/rtable3.c

index 50079fcca9f31843f99079c8043be3f8026df8a7..faecb2aed2a61559db92df139285dd5c10d6f0d0 100644 (file)
@@ -357,11 +357,13 @@ _DtCm_register_callback_3_svc(Registration_3 *r, struct svc_req *svcrq)
 
         stat = 0;
 
-        newreg = _DtCm_reg3_to_reg4(r);      
-        newstat = _DtCm_register_callback_4_svc(newreg, svcrq);      
-        stat = _DtCm_regstat4_to_regstat3(*newstat);      
+        newreg = _DtCm_reg3_to_reg4(r);
+        if(newreg) {
+                newstat = _DtCm_register_callback_4_svc(newreg, svcrq);
+                stat = _DtCm_regstat4_to_regstat3(*newstat);
 
-        if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);        
+                xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
+        }
        return(&stat);
 }