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

index e8b92f3917c6291f7223b6adeecab097ea4298e9..c4438f136644cc3c3d17b350d46081553e3342a1 100644 (file)
@@ -215,11 +215,13 @@ _DtCm_rtable_delete_instance_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
         if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
 
        newargs = _DtCm_tabledelargs2_to_tabledelargs4(args, do_one_4);
-       newres = _DtCm_rtable_delete_4_svc(newargs, svcrq);  
-        res = _DtCm_tableres4_to_tableres2(newres);   
+        if(newargs) {
+                newres = _DtCm_rtable_delete_4_svc(newargs, svcrq);
+                res = _DtCm_tableres4_to_tableres2(newres);
    
-        if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);   
-       
+                xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
+        }
+
         return(res);
 }