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

index 00d04af3ba83b9f7c8f76daf699b284cd1b49c30..6486e3341f1a9a2056788ee5c67050d0cfbbfd9b 100644 (file)
@@ -176,11 +176,13 @@ _DtCm_rtable_insert_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_tableargs2_to_tableargs4(args);
-        newres = _DtCm_rtable_insert_4_svc(newargs, svcrq);
-         
-        res = _DtCm_tableres4_to_tableres2(newres);
+        if(newargs) {
+                newres = _DtCm_rtable_insert_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);
 }