Projects
openEuler:24.03:SP1:Everything:64G
hostname
_service:tar_scm:5000-fix-memory-leak.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:5000-fix-memory-leak.patch of Package hostname
From ddacb22dac891332c759293ab6297090216b121b Mon Sep 17 00:00:00 2001 From: binlingyu <binlingyu@uniontech.com> Date: Mon, 20 May 2024 16:24:12 +0800 Subject: [PATCH] fix-memory-leak --- hostname.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hostname.c b/hostname.c index 5be268e..63200be 100644 --- a/hostname.c +++ b/hostname.c @@ -262,15 +262,20 @@ show_name(enum type_t type) switch(type) { case DEFAULT: - printf("%s\n", localhost()); + p=localhost(); + printf("%s\n", p); + free(p); break; case SHORT: p = localhost(); *(strchrnul(p, '.')) = '\0'; printf("%s\n", p); + free(p); break; case NIS: - printf("%s\n", localdomain()); + p=localdomain(); + printf("%s\n", p); + free(p); break; case NIS_DEF: printf("%s\n", localnisdomain()); -- 2.20.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2