From b222cfec1bb9d5451e6e64ad155dff10683453e7 Mon Sep 17 00:00:00 2001 From: xushengbin Date: Thu, 6 Mar 2025 01:33:21 +0000 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81FDSAN=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xushengbin --- qos_manager/src/qos_common.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qos_manager/src/qos_common.cpp b/qos_manager/src/qos_common.cpp index 02bf87a..5efe241 100644 --- a/qos_manager/src/qos_common.cpp +++ b/qos_manager/src/qos_common.cpp @@ -62,7 +62,9 @@ int AuthEnable(int pid, unsigned int flag, unsigned int status) RME_LOGE("auth enable failed for pid %{public}d with status %{public}u\n", pid, status); } FILE* f = fdopen(fd, "r+"); - fclose(f); + if (f != nullptr) { + fclose(f); + } return ret; } @@ -89,7 +91,9 @@ int AuthPause(int pid) RME_LOGE("auth pause failed for pid %{public}d\n", pid); } FILE* f = fdopen(fd, "r+"); - fclose(f); + if (f != nullptr) { + fclose(f); + } return ret; } @@ -113,7 +117,9 @@ int AuthDelete(int pid) RME_LOGE("auth delete failed for pid %{public}d\n", pid); } FILE* f = fdopen(fd, "r+"); - fclose(f); + if (f != nullptr) { + fclose(f); + } return ret; }