mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* malloc/malloc.c (_int_free): Remove test for NULL parameter. (_int_realloc): Call _int_free only if memory parameter is not NULL.
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
2004-11-12 Ulrich Drepper <drepper@redhat.com>
|
2004-11-12 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* malloc/malloc.c (_int_free): Remove test for NULL parameter.
|
||||||
|
(_int_realloc): Call _int_free only if memory parameter is not NULL.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/libc_fatal.c: Add new function __libc_message
|
* sysdeps/unix/sysv/linux/libc_fatal.c: Add new function __libc_message
|
||||||
which performs the printing and simple format string handling. The
|
which performs the printing and simple format string handling. The
|
||||||
string is written to tty, stderr, syslog in this order, stopping after
|
string is written to tty, stderr, syslog in this order, stopping after
|
||||||
|
@ -4196,8 +4196,6 @@ _int_free(mstate av, Void_t* mem)
|
|||||||
mchunkptr fwd; /* misc temp for linking */
|
mchunkptr fwd; /* misc temp for linking */
|
||||||
|
|
||||||
|
|
||||||
/* free(0) has no effect */
|
|
||||||
if (mem != 0) {
|
|
||||||
const char *errstr = NULL;
|
const char *errstr = NULL;
|
||||||
|
|
||||||
p = mem2chunk(mem);
|
p = mem2chunk(mem);
|
||||||
@ -4382,7 +4380,6 @@ _int_free(mstate av, Void_t* mem)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
------------------------- malloc_consolidate -------------------------
|
------------------------- malloc_consolidate -------------------------
|
||||||
@ -4528,6 +4525,7 @@ _int_realloc(mstate av, Void_t* oldmem, size_t bytes)
|
|||||||
|
|
||||||
#if REALLOC_ZERO_BYTES_FREES
|
#if REALLOC_ZERO_BYTES_FREES
|
||||||
if (bytes == 0) {
|
if (bytes == 0) {
|
||||||
|
if (oldmem != 0)
|
||||||
_int_free(av, oldmem);
|
_int_free(av, oldmem);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,8 @@ __libc_message (int do_abort, const char *fmt, ...)
|
|||||||
if (! written)
|
if (! written)
|
||||||
vsyslog (LOG_ERR, fmt, ap_copy);
|
vsyslog (LOG_ERR, fmt, ap_copy);
|
||||||
|
|
||||||
|
va_end (ap_copy);
|
||||||
|
|
||||||
if (do_abort()
|
if (do_abort()
|
||||||
/* Kill the application. */
|
/* Kill the application. */
|
||||||
abort ();
|
abort ();
|
||||||
|
@ -141,6 +141,8 @@ __libc_message (int do_abort, const char *fmt, ...)
|
|||||||
if (! written)
|
if (! written)
|
||||||
vsyslog (LOG_ERR, fmt, ap_copy);
|
vsyslog (LOG_ERR, fmt, ap_copy);
|
||||||
|
|
||||||
|
va_end (ap_copy);
|
||||||
|
|
||||||
if (do_abort)
|
if (do_abort)
|
||||||
/* Terminate the process. */
|
/* Terminate the process. */
|
||||||
abort ();
|
abort ();
|
||||||
|
Reference in New Issue
Block a user