Welcome! Log In Create A New Profile

Advanced

[njs] Improved njs_mp_free() to aling with free() semantics.

Dmitry Volyntsev
September 08, 2022 01:44PM
details: https://hg.nginx.org/njs/rev/4689935e5d36
branches:
changeset: 1950:4689935e5d36
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu Sep 08 10:03:25 2022 -0700
description:
Improved njs_mp_free() to aling with free() semantics.

Previously, njs_mp_free() issued an assertion when p == NULL, while NULL
argument is explicitly allowed for free().

diffstat:

src/njs_mp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r a2db32044812 -r 4689935e5d36 src/njs_mp.c
--- a/src/njs_mp.c Tue Sep 06 18:44:47 2022 -0700
+++ b/src/njs_mp.c Thu Sep 08 10:03:25 2022 -0700
@@ -682,7 +682,7 @@ njs_mp_free(njs_mp_t *mp, void *p)
}

} else {
- njs_assert_msg(0, "freed pointer is out of mp: %p\n", p);
+ njs_assert_msg(p == NULL, "freed pointer is out of mp: %p\n", p);
}
}

_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[njs] Improved njs_mp_free() to aling with free() semantics.

Dmitry Volyntsev 283 September 08, 2022 01:44PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready