summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2024-04-08 10:48:24 +0200
committerBenBE <BenBE@geshi.org>2024-04-08 18:38:34 +0200
commit1a12d5852602a7507d5911408561a754c446539c (patch)
tree63dc6cdfac4530ea758ffc42d587e593829d33af
parent327593e5cd5d48a6ff38d2877d7faaf53a6a8892 (diff)
Work around GCC14 memleak diagnostic
While both pointers are identical, GCC-14 with -fanalyzer complains about these return statements to leak memory. The leak is only reported with LTO though.
-rw-r--r--darwin/DarwinProcess.c2
-rw-r--r--dragonflybsd/DragonFlyBSDProcess.c2
-rw-r--r--freebsd/FreeBSDProcess.c2
-rw-r--r--linux/LinuxProcess.c2
-rw-r--r--netbsd/NetBSDProcess.c2
-rw-r--r--openbsd/OpenBSDProcess.c2
-rw-r--r--pcp/PCPProcess.c2
-rw-r--r--solaris/SolarisProcess.c2
8 files changed, 8 insertions, 8 deletions
diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c
index 29563a64..1da4221c 100644
--- a/darwin/DarwinProcess.c
+++ b/darwin/DarwinProcess.c
@@ -62,7 +62,7 @@ Process* DarwinProcess_new(const Machine* host) {
this->taskAccess = true;
this->translated = false;
- return &this->super;
+ return (Process*)this;
}
void Process_delete(Object* cast) {
diff --git a/dragonflybsd/DragonFlyBSDProcess.c b/dragonflybsd/DragonFlyBSDProcess.c
index 915ecd09..002378a7 100644
--- a/dragonflybsd/DragonFlyBSDProcess.c
+++ b/dragonflybsd/DragonFlyBSDProcess.c
@@ -56,7 +56,7 @@ Process* DragonFlyBSDProcess_new(const Machine* host) {
DragonFlyBSDProcess* this = xCalloc(1, sizeof(DragonFlyBSDProcess));
Object_setClass(this, Class(DragonFlyBSDProcess));
Process_init(&this->super, host);
- return &this->super;
+ return (Process*)this;
}
void Process_delete(Object* cast) {
diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c
index 901f9dad..662943c9 100644
--- a/freebsd/FreeBSDProcess.c
+++ b/freebsd/FreeBSDProcess.c
@@ -62,7 +62,7 @@ Process* FreeBSDProcess_new(const Machine* machine) {
FreeBSDProcess* this = xCalloc(1, sizeof(FreeBSDProcess));
Object_setClass(this, Class(FreeBSDProcess));
Process_init(&this->super, machine);
- return &this->super;
+ return (Process*)this;
}
void Process_delete(Object* cast) {
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index f809cc60..741fe19d 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -118,7 +118,7 @@ Process* LinuxProcess_new(const Machine* host) {
LinuxProcess* this = xCalloc(1, sizeof(LinuxProcess));
Object_setClass(this, Class(LinuxProcess));
Process_init(&this->super, host);
- return &this->super;
+ return (Process*)this;
}
void Process_delete(Object* cast) {
diff --git a/netbsd/NetBSDProcess.c b/netbsd/NetBSDProcess.c
index 3af5a872..5462e721 100644
--- a/netbsd/NetBSDProcess.c
+++ b/netbsd/NetBSDProcess.c
@@ -219,7 +219,7 @@ Process* NetBSDProcess_new(const Machine* host) {
NetBSDProcess* this = xCalloc(1, sizeof(NetBSDProcess));
Object_setClass(this, Class(NetBSDProcess));
Process_init(&this->super, host);
- return &this->super;
+ return (Process*)this;
}
void Process_delete(Object* cast) {
diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c
index 4ac7aef1..7f50b0f8 100644
--- a/openbsd/OpenBSDProcess.c
+++ b/openbsd/OpenBSDProcess.c
@@ -211,7 +211,7 @@ Process* OpenBSDProcess_new(const Machine* host) {
OpenBSDProcess* this = xCalloc(1, sizeof(OpenBSDProcess));
Object_setClass(this, Class(OpenBSDProcess));
Process_init(&this->super, host);
- return &this->super;
+ return (Process*)this;
}
void Process_delete(Object* cast) {
diff --git a/pcp/PCPProcess.c b/pcp/PCPProcess.c
index 27630fc5..e8cc1aad 100644
--- a/pcp/PCPProcess.c
+++ b/pcp/PCPProcess.c
@@ -97,7 +97,7 @@ Process* PCPProcess_new(const Machine* host) {
PCPProcess* this = xCalloc(1, sizeof(PCPProcess));
Object_setClass(this, Class(PCPProcess));
Process_init(&this->super, host);
- return &this->super;
+ return (Process*)this;
}
void Process_delete(Object* cast) {
diff --git a/solaris/SolarisProcess.c b/solaris/SolarisProcess.c
index 2dd03f0f..29e981df 100644
--- a/solaris/SolarisProcess.c
+++ b/solaris/SolarisProcess.c
@@ -64,7 +64,7 @@ Process* SolarisProcess_new(const Machine* host) {
SolarisProcess* this = xCalloc(1, sizeof(SolarisProcess));
Object_setClass(this, Class(SolarisProcess));
Process_init(&this->super, host);
- return &this->super;
+ return (Process*)this;
}
void Process_delete(Object* cast) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy