diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-03-03 17:42:47 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-03-07 00:06:24 +0000 |
commit | b3b0c1ad25a5d0f628eddd00113a40364d68480b (patch) | |
tree | 7b1088ab3cc984dd606df1b56fdda7dec975432f /src/GetResList.c | |
parent | b1b54c50d0e5851d72c1e7aff4057687be2e447e (diff) |
Replace XtMalloc() calls with XtMallocArray()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/GetResList.c')
-rw-r--r-- | src/GetResList.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/GetResList.c b/src/GetResList.c index 3bb2387..cc3ee4e 100644 --- a/src/GetResList.c +++ b/src/GetResList.c @@ -90,8 +90,9 @@ XtGetResourceList(WidgetClass widget_class, register XtResourceList *list, dlist; LOCK_PROCESS; + *resources = XtMallocArray(widget_class->core_class.num_resources, + (Cardinal) sizeof(XtResource)); size = (int) (widget_class->core_class.num_resources * sizeof(XtResource)); - *resources = (XtResourceList) __XtMalloc((unsigned) size); if (!widget_class->core_class.class_inited) { /* Easy case */ @@ -162,8 +163,9 @@ XtGetConstraintResourceList(WidgetClass widget_class, return; } + *resources = XtMallocArray(class->constraint_class.num_resources, + (Cardinal) sizeof(XtResource)); size = (int) (class->constraint_class.num_resources * sizeof(XtResource)); - *resources = (XtResourceList) __XtMalloc((unsigned) size); if (!class->core_class.class_inited) { /* Easy case */ |