Is there any problem in the code that you can tell me, my application crashed randomly me any logical Or memory can not get the error, please help as it is getting out of my scope.
#define __FN__ "CGD9_gd_ParseAddFieldsProC" int CGD9_gd_ParseAddFieldsProC (CGD_gd_ParseAddFields_Iparam_t * i_param_st_p) {t_gd9adfld_t * p_ext_fields_s = NULL; T_gd9sbdat_t * p_buff = (t_gd9sbdat_t *) (i_param_st_p-> i_add_fields_st); Trace (__FN__); DEBUG_GD_1 ("\ n \ nFunction% s - started. \ N \ n", __FN__); If (* (i_param_st_p- & gt; o_add_fields) == null) {ERR_Report_1 (DGD_ERR_IN_FUNCTION, __FN__ "Error - Program, the input has not been started extended struct \ will crash!"); Check ERR_Report_1 (DGD_ERR_IN_FUNCTION, __FN __ \ "is used in the exit point CMI9_auxc_A_GUIDING_init_forProc \ GD table!"); Fflush (zero); Return failure; } P_ext_fields_s = * (i_param_st_p-> o_add_fields); Memset (p_ext_fields_s, '', sizeof (t_gd9adfld_t)); / * Copy GD After all extended areas with tables * / memcpy a (& amp buffer to be; p_ext_fields_s- & gt; rowid, & amp; p_buff [i_param_st_p- & gt; output_index] .rowid, sizeof (p_buff [i_param_st_p- & gt; output_index ]. Rowid)); Memset (p_ext_fields_s-> rowid, '0', 18); Mmkpyr (& amp; P_akst_failds_s- & gt; L9_ligesi_prod_taip, & amp; P_buff [I_prm_sat_p- & gt; Autput_indeks] Kl9_ligesi_prod_taip, Sizof (P_akst_failds_s- & gt; L9_ligesi_prod_taip)); / * Allocated memory free * for extended areas * / free (i_param_st_p -> i_add_fields_st); I_param_st_p - & gt; I_add_fields_st = NULL; DEBUG_GD_1 ("\ n \ nFunction% s - Successfully completed. \ N \ n", __FN__); Return success; }
shot in the dark:
you use Are
memcpy (& amp; p_ext_fields_s-> rowid ... but
memset (p_ext_fields_s- & gt; rowid ...
so maybe it should be
memset (& amp; p_ext_fields_s- & gt; rowid ,
Instead? But if this was really a problem, then I expect it to not happen accidentally, but I crash every time ...
Comments
Post a Comment