fixbug: fd leak

This commit is contained in:
yanansong 2023-11-21 15:24:20 +08:00
parent 3655492006
commit dea70aba22
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff --git a/services/param/linux/param_request.c b/services/param/linux/param_request.c
index 460486d..6bcd72d 100644
--- a/services/param/linux/param_request.c
+++ b/services/param/linux/param_request.c
@@ -50,6 +50,7 @@ static int GetClientSocket()
serverAddr.sun_family = PF_UNIX;
strncpy(serverAddr.sun_path, PIPE_NAME, strlen(PIPE_NAME));
if (connect(cfd, (struct sockaddr*)&serverAddr, sizeof(serverAddr)) < 0) {
+ close(cfd);
perror("Failed to connect");
return -1;
}

View File

@ -23,7 +23,7 @@
Name: distributed-utils
Version: 1.0.0
Release: 5
Release: 6
Summary: Distributed middleware used components.
License: Apache-2.0 and MIT
Url: https://gitee.com/openharmony/
@ -60,6 +60,7 @@ Patch11: 0011-remove-dependency-and-adapt-for-build-device_manager.patch
Patch12: 0012-remove-dependency-and-adapt-for-build-device_security_level.patch
Patch13: 0013-increase-the-pthread-stack-size-of-x86-and-other-env-dsoftbus.patch
Patch14: 0014-fixbug-metaDescriptor-for-ipc.patch
Patch15: 0015_fixbug_fd_leak_for_init.patch
BuildRequires: python3-jinja2 python3-pyyaml cjson cjson-devel
BuildRequires: libatomic libicu-devel libxml2-devel openssl-devel
@ -117,6 +118,7 @@ rm -rf %{_builddir}/third_party/mbedtls/*
%patch12 -p1 -d %{device_security_level_dir}
%patch13 -p1 -d %{dsoftbus_dir}
%patch14 -p1 -d %{ipc_dir}
%patch15 -p1 -d %{init_dir}
# build all components with build.sh
%build
@ -215,6 +217,9 @@ cp -rvf single_include/nlohmann %{buildroot}/%{_includedir}/nlohmann_json/single
/usr/bin/*
%changelog
* Tue Nov 21 2023 yanansong <songyanan5@huawei.com> - 1.0.0-6
- fixbug fd leak for init module.
* Fri Oct 27 2023 yanansong <songyanan5@huawei.com> - 1.0.0-5
- fixbug metaDescriptor initialization.