Skip to content

Commit dbb6d86

Browse files
committed
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*.
1 parent 6986c63 commit dbb6d86

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/drivers.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,5 @@ SR_API void sr_drivers_init(struct sr_context *ctx)
5252
drivers < sr_driver_list__stop; drivers++)
5353
g_array_append_val(array, *drivers);
5454
#endif
55-
ctx->driver_list = (struct sr_dev_driver **)array->data;
56-
g_array_free(array, FALSE);
55+
ctx->driver_list = (struct sr_dev_driver **)g_array_free(array, FALSE);
5756
}

0 commit comments

Comments
 (0)