Skip to content

Commit 7fcd1ca

Browse files
authored
Merge pull request #73 from ityuhui/yh-number-array
Allocate memory for the element of array when the type is number
2 parents 10f60c7 + d710fc9 commit 7fcd1ca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

kubernetes/model/v1_pod_security_context.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,13 @@ v1_pod_security_context_t *v1_pod_security_context_parseFromJSON(cJSON *v1_pod_s
230230
{
231231
goto end;
232232
}
233-
list_addElement(supplemental_groupsList , &supplemental_groups_local->valuedouble);
233+
double *supplemental_groups_local_value = (double *)calloc(1, sizeof(double));
234+
if(!supplemental_groups_local_value)
235+
{
236+
goto end;
237+
}
238+
*supplemental_groups_local_value = supplemental_groups_local->valuedouble;
239+
list_addElement(supplemental_groupsList , supplemental_groups_local_value);
234240
}
235241
}
236242

0 commit comments

Comments
 (0)