From f20a0e14e099a9257ccd5c958745b9f356b8b5bc Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Mon, 2 Dec 2019 17:15:46 -0600 Subject: [PATCH] st/oxr: Fix oversized allocation in binding code --- src/xrt/state_trackers/oxr/oxr_binding.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_binding.c b/src/xrt/state_trackers/oxr/oxr_binding.c index 27de140dc..be04228ce 100644 --- a/src/xrt/state_trackers/oxr/oxr_binding.c +++ b/src/xrt/state_trackers/oxr/oxr_binding.c @@ -205,9 +205,9 @@ interaction_profile_find_or_create(struct oxr_logger *log, } // Add to the list of currently created interaction profiles. - size_t size = - sizeof(struct oxr_interaction_profile) * (inst->num_profiles + 1); - inst->profiles = realloc(inst->profiles, size); + U_ARRAY_REALLOC_OR_FREE(inst->profiles, + struct oxr_interaction_profile *, + (inst->num_profiles + 1)); inst->profiles[inst->num_profiles++] = p; *out_p = p;