From: fenugrec Date: Mon, 20 Nov 2023 22:19:39 +0000 (-0500) Subject: drivers: assign driver_list with g_array_free() X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=dbb6d86ba6a486be4d1616347e33790c4f343e27;p=libsigrok.git drivers: assign driver_list with g_array_free() To make it clear we are free'ing the array while keeping its data, use the return value from g_array_free(). Keep the cast since ret type is a gchar*. --- diff --git a/src/drivers.c b/src/drivers.c index bf3f0b04..6dc2c55c 100644 --- a/src/drivers.c +++ b/src/drivers.c @@ -52,6 +52,5 @@ SR_API void sr_drivers_init(struct sr_context *ctx) drivers < sr_driver_list__stop; drivers++) g_array_append_val(array, *drivers); #endif - ctx->driver_list = (struct sr_dev_driver **)array->data; - g_array_free(array, FALSE); + ctx->driver_list = (struct sr_dev_driver **)g_array_free(array, FALSE); }