Clear start_items when reading a new value (#8493)

Fixes #8492
This commit is contained in:
Vincent Stumpf 2024-07-04 12:50:40 -07:00 committed by GitHub
parent 529d8fea3d
commit 4f2beac029
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2837,6 +2837,7 @@ void char_config_split_startpoint( char* w1_value, char* w2_value, struct s_poin
size_t fields_length = 3 + 1;
(*count) = 0; // Reset to begin reading
memset(start_point, 0, sizeof(struct s_point_str) * MAX_STARTPOINT);
fields = (char **)aMalloc(fields_length * sizeof(char *));
if (fields == nullptr)
@ -2876,6 +2877,8 @@ void char_config_split_startitem(char *w1_value, char *w2_value, struct startite
int i = 0;
size_t fields_length = 3 + 1;
memset(start_items, 0, sizeof(struct startitem) * MAX_STARTITEM);
fields = (char **)aMalloc(fields_length * sizeof(char *));
if (fields == nullptr)
return; // Failed to allocate memory.