dtcm: Coverity 88168
authorPeter Howkins <flibble@users.sf.net>
Fri, 13 Jul 2018 16:47:01 +0000 (17:47 +0100)
committerPeter Howkins <flibble@users.sf.net>
Fri, 13 Jul 2018 16:47:01 +0000 (17:47 +0100)
cde/programs/dtcm/server/rtable2.c

index 90945751bb5a5dfeea75c5b732d65bc2d67de2a6..340ab794852ea20f0d531344d42cd8ebff3c5256 100644 (file)
@@ -66,11 +66,13 @@ _DtCm_rtable_lookup_2_svc (Table_Args_2 *args, struct svc_req *svcrq)
        if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
 
        newargs = _DtCm_tableargs2_to_tableargs4(args);
-       newres = _DtCm_rtable_lookup_4_svc(newargs, svcrq); 
-       
-       res = _DtCm_tableres4_to_tableres2(newres);
+       if(newargs) {
+               newres = _DtCm_rtable_lookup_4_svc(newargs, svcrq); 
 
-       if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
+               res = _DtCm_tableres4_to_tableres2(newres);
+
+               xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
+       }
 
        return(res);
 }