1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtcm: When freeing pointer, set the pointer to NULL, so that on future failures you don't return a pointer to freed data

This commit is contained in:
Peter Howkins 2018-07-13 17:59:21 +01:00
parent 8eab8d07ce
commit 661e91d4a5

View file

@ -63,7 +63,7 @@ _DtCm_rtable_lookup_2_svc (Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs; Table_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) { 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
newres = _DtCm_rtable_lookup_next_larger_4_svc(newargs, svcrq); 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) { 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
newres = _DtCm_rtable_lookup_range_4_svc(newargs, svcrq); 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) { if(newargs) {
@ -171,7 +171,7 @@ _DtCm_rtable_insert_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs; Table_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
newres = _DtCm_rtable_insert_4_svc(newargs, svcrq); 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tabledelargs2_to_tabledelargs4(args, do_all_4);
newres = _DtCm_rtable_delete_4_svc(newargs, svcrq); 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tabledelargs2_to_tabledelargs4(args, do_one_4);
newres = _DtCm_rtable_delete_4_svc(newargs, svcrq); 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) { 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) { 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_Args_4 *newargs;
Table_Res_4 *newres; 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); newargs = _DtCm_tableargs2_to_tableargs4(args);
newres = _DtCm_rtable_lookup_next_reminder_4_svc(newargs, svcrq); 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 *newargs;
Access_Args_4 *newres; 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); newargs = _DtCm_accargs2_to_accargs4(args);
newres = _DtCm_rtable_get_access_4_svc(newargs, svcrq); newres = _DtCm_rtable_get_access_4_svc(newargs, svcrq);