From: Peter Howkins Date: Fri, 13 Jul 2018 16:59:21 +0000 (+0100) Subject: dtcm: When freeing pointer, set the pointer to NULL, so that on future failures you... X-Git-Tag: 2.3.0a~108 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=661e91d4a52e1e19212b8ecb1fb57ee01bfbd35c;p=oweals%2Fcde.git dtcm: When freeing pointer, set the pointer to NULL, so that on future failures you don't return a pointer to freed data --- diff --git a/cde/programs/dtcm/server/rtable2.c b/cde/programs/dtcm/server/rtable2.c index 86f8af04..3436d095 100644 --- a/cde/programs/dtcm/server/rtable2.c +++ b/cde/programs/dtcm/server/rtable2.c @@ -63,7 +63,7 @@ _DtCm_rtable_lookup_2_svc (Table_Args_2 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL; newargs = _DtCm_tableargs2_to_tableargs4(args); if(newargs) { @@ -85,7 +85,7 @@ _DtCm_rtable_lookup_next_larger_2_svc(Table_Args_2 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + 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_lookup_next_larger_4_svc(newargs, svcrq); @@ -106,7 +106,7 @@ _DtCm_rtable_lookup_next_smaller_2_svc(Table_Args_2 *args, struct svc_req *svcrq Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL; newargs = _DtCm_tableargs2_to_tableargs4(args); if(newargs) { @@ -129,7 +129,7 @@ _DtCm_rtable_lookup_range_2_svc(Table_Args_2 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + 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_lookup_range_4_svc(newargs, svcrq); @@ -149,7 +149,7 @@ _DtCm_rtable_abbreviated_lookup_range_2_svc(Table_Args_2 *args, struct svc_req * Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL; newargs = _DtCm_tableargs2_to_tableargs4(args); if(newargs) { @@ -171,7 +171,7 @@ _DtCm_rtable_insert_2_svc(Table_Args_2 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + 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); @@ -191,7 +191,7 @@ _DtCm_rtable_delete_2_svc(Table_Args_2 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL; newargs = _DtCm_tabledelargs2_to_tabledelargs4(args, do_all_4); newres = _DtCm_rtable_delete_4_svc(newargs, svcrq); @@ -210,7 +210,7 @@ _DtCm_rtable_delete_instance_2_svc(Table_Args_2 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + 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); @@ -229,7 +229,7 @@ _DtCm_rtable_change_2_svc(Table_Args_2 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL; newargs = _DtCm_tableargs2_to_tableargs4(args); if(newargs) { @@ -251,7 +251,7 @@ _DtCm_rtable_change_instance_2_svc(Table_Args_2 *args, struct svc_req *svcrq) Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL; newargs = _DtCm_tableargs2_to_tableargs4(args); if(newargs) { @@ -273,7 +273,7 @@ _DtCm_rtable_lookup_next_reminder_2_svc(Table_Args_2 *args, struct svc_req *svcr Table_Args_4 *newargs; Table_Res_4 *newres; - if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); + 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_lookup_next_reminder_4_svc(newargs, svcrq); @@ -400,7 +400,7 @@ _DtCm_rtable_get_access_2_svc(Access_Args_2 *args, struct svc_req *svcrq) Access_Args_4 *newargs; Access_Args_4 *newres; - if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_2, (char*)res); + if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_2, (char*)res); res = NULL; newargs = _DtCm_accargs2_to_accargs4(args); newres = _DtCm_rtable_get_access_4_svc(newargs, svcrq);