mirror of
https://github.com/samba-team/samba.git
synced 2025-12-16 00:23:52 +03:00
this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also.
This commit is contained in:
@@ -415,20 +415,22 @@ static void adjust_do_list_queue(void)
|
||||
|
||||
static void add_to_do_list_queue(const char* entry)
|
||||
{
|
||||
char *dlq;
|
||||
long new_end = do_list_queue_end + ((long)strlen(entry)) + 1;
|
||||
while (new_end > do_list_queue_size)
|
||||
{
|
||||
do_list_queue_size *= 2;
|
||||
DEBUG(4,("enlarging do_list_queue to %d\n",
|
||||
(int)do_list_queue_size));
|
||||
do_list_queue = Realloc(do_list_queue, do_list_queue_size);
|
||||
if (! do_list_queue) {
|
||||
dlq = Realloc(do_list_queue, do_list_queue_size);
|
||||
if (! dlq) {
|
||||
DEBUG(0,("failure enlarging do_list_queue to %d bytes\n",
|
||||
(int)do_list_queue_size));
|
||||
reset_do_list_queue();
|
||||
}
|
||||
else
|
||||
{
|
||||
do_list_queue = dlq;
|
||||
memset(do_list_queue + do_list_queue_size / 2,
|
||||
0, do_list_queue_size / 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user