diff options
author | Peter Zhu <[email protected]> | 2023-06-29 16:31:35 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-06-30 09:13:31 -0400 |
commit | 58386814a7c7275f66ffa111175fca2fe307a1b5 (patch) | |
tree | 56bfd1daec3a6d83dfda64b569de1b9fbbb4d23c /vm_backtrace.c | |
parent | 37a893d12915b8860f6880d6a0c2859e096ab4ff (diff) |
Don't check for null pointer in calls to free
According to the C99 specification section 7.20.3.2 paragraph 2:
> If ptr is a null pointer, no action occurs.
So we do not need to check that the pointer is a null pointer.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8004
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r-- | vm_backtrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c index 9a041c4c2c..e46eaa5b81 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -478,7 +478,7 @@ static void backtrace_free(void *ptr) { rb_backtrace_t *bt = (rb_backtrace_t *)ptr; - if (bt->backtrace) ruby_xfree(bt->backtrace); + ruby_xfree(bt->backtrace); ruby_xfree(bt); } |