From 118331d20a8becee958c8aaeebab8ebe685b7136 Mon Sep 17 00:00:00 2001 From: Lohit Agarwalla Date: Tue, 31 Aug 2021 13:13:33 +0530 Subject: [PATCH] Free pch in case of error Change-Id: I30c5099adb38117577b98a2231f6e226d7157cf9 Signed-off-by: Lohit Agarwalla --- src/oauth2_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oauth2_util.c b/src/oauth2_util.c index 376f40d..d45422b 100644 --- a/src/oauth2_util.c +++ b/src/oauth2_util.c @@ -107,7 +107,7 @@ oauth2_util_get_params(const char *url_part, bundle **params) int key_size = (eq_ptr - tmp_start) + 1; char *key = (char *) malloc((key_size) * sizeof(char)); - OAUTH2_RETURN_VAL(key, {}, OAUTH2_ERROR_OUT_OF_MEMORY, + OAUTH2_RETURN_VAL(key, {g_strfreev(pch);}, OAUTH2_ERROR_OUT_OF_MEMORY, "Out of memory"); memset(key, '\0', ((eq_ptr - tmp_start) + 1) * sizeof(char)); strncpy(key, tmp_start, (eq_ptr - tmp_start)); -- 2.7.4