From e978021fa99dfa43df6ae1f4bac552b8881d23dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B5=AB=E7=84=B6?= Date: Wed, 6 Nov 2024 11:05:37 +0800 Subject: [PATCH] Fix parse file access user error --- 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 c3323a13..de580a57 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