Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1062-erts-inet-drv-Revert-the-FREE-macro.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1062-erts-inet-drv-Revert-the-FREE-macro.patch of Package erlang
From 590947d29afeed39211d2a6cd05d7be39f61f82b Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Wed, 18 May 2022 16:57:44 +0200 Subject: [PATCH 2/3] [erts|inet-drv] Revert the FREE macro Revert the FREE macro to its previous form (without the 'nullification'). Use explicit NULL instead. OTP-18102 --- erts/emulator/drivers/common/inet_drv.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c index b6bd30481f..1740da1b53 100644 --- a/erts/emulator/drivers/common/inet_drv.c +++ b/erts/emulator/drivers/common/inet_drv.c @@ -1558,14 +1558,12 @@ static void *realloc_wrapper(void *current, ErlDrvSizeT size){ return ret; } #define REALLOC(X,Y) realloc_wrapper(X,Y) -#define FREE(P) { driver_free((P)); \ - (P) = NULL;} +#define FREE(P) driver_free((P)) #else /* FATAL_MALLOC */ -#define ALLOC(X) driver_alloc((X)) +#define ALLOC(X) driver_alloc((X)) #define REALLOC(X,Y) driver_realloc((X), (Y)) -#define FREE(P) { driver_free((P)); \ - (P) = NULL;} +#define FREE(P) driver_free((P)) #endif /* FATAL_MALLOC */ @@ -5908,6 +5906,7 @@ static ErlDrvSSizeT inet_ctl_getifaddrs(inet_descriptor* desc_p, } if (! i) { FREE(ip_adaddrs_p); + ip_adaddrs_p = NULL; } } else ip_adaddrs_p = NULL; } @@ -5926,7 +5925,10 @@ static ErlDrvSSizeT inet_ctl_getifaddrs(inet_descriptor* desc_p, i = 0; break; } - if (! i) FREE(info_p); + if (! i) { + FREE(info_p); + info_p = NULL; + } } if (! ip_adaddrs_p) { -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor