From b1e7323647f778c97a5e1cf4d3d67091e98b5c33 Mon Sep 17 00:00:00 2001 From: feiniks <36756310+feiniks@users.noreply.github.com> Date: Sat, 9 Nov 2024 14:43:25 +0800 Subject: [PATCH] Fix parse file access user error (#714) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 杨赫然 --- server/http-tx-mgr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/http-tx-mgr.c b/server/http-tx-mgr.c index c3323a1..de580a5 100644 --- a/server/http-tx-mgr.c +++ b/server/http-tx-mgr.c @@ -664,6 +664,7 @@ parse_file_access_info (const char *rsp_content, int rsp_size) json_t *object; json_error_t jerror; const char *user = NULL; + char *ret = NULL; object = json_loadb (rsp_content, rsp_size, 0, &jerror); if (!object) { @@ -676,11 +677,12 @@ parse_file_access_info (const char *rsp_content, int rsp_size) seaf_warning ("Failed to find user in json when check file access in Seahub.\n"); goto out; } + ret = g_strdup (user); out: json_decref (object); - return g_strdup (user); + return ret; } int