From f7e487584d1a22ffcfd910e9ae47429599c39b44 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 13 Apr 2022 14:23:47 +0100 Subject: trivial: Fix a small memory leak when opening the Huey device --- src/sensors/huey/huey-ctx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sensors/huey/huey-ctx.c b/src/sensors/huey/huey-ctx.c index 09f83ea..1b7b1ea 100644 --- a/src/sensors/huey/huey-ctx.c +++ b/src/sensors/huey/huey-ctx.c @@ -90,6 +90,7 @@ huey_ctx_setup (HueyCtx *ctx, GError **error) { gboolean ret; HueyCtxPrivate *priv = GET_PRIVATE (ctx); + g_autofree gchar *calibration_crt = NULL; g_return_val_if_fail (HUEY_IS_CTX (ctx), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -113,8 +114,8 @@ huey_ctx_setup (HueyCtx *ctx, GError **error) error); if (!ret) return FALSE; - g_debug ("device calibration CRT: %s", - cd_mat33_to_string (&priv->calibration_crt)); + calibration_crt = cd_mat33_to_string (&priv->calibration_crt); + g_debug ("device calibration CRT: %s", calibration_crt); /* this number is different on all three hueys */ ret = huey_device_read_register_float (priv->device, -- cgit v1.2.1