summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2022-04-13 14:23:47 +0100
committerRichard Hughes <richard@hughsie.com>2022-04-13 14:42:28 +0100
commitf7e487584d1a22ffcfd910e9ae47429599c39b44 (patch)
tree41bfbd7757a45804d13df224857baa9aaa45e7e8
parent1452a975ecae14299fb27d41522dfd32305481ce (diff)
downloadcolord-f7e487584d1a22ffcfd910e9ae47429599c39b44.tar.gz
trivial: Fix a small memory leak when opening the Huey device
-rw-r--r--src/sensors/huey/huey-ctx.c5
1 files 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,