mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-17 14:07:03 +01:00
Fix usage of realloc.
This commit is contained in:
parent
9e83404751
commit
edd95da365
@ -1,3 +1,10 @@
|
|||||||
|
2009-12-02 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* trustlist.c (read_trustfiles): Store the pointer returned from
|
||||||
|
shrinking the memory and not the orginal one. Fixes bug#1163.
|
||||||
|
Reported by TAKAHASHI Tamotsu. Also return correct error after
|
||||||
|
memory failure.
|
||||||
|
|
||||||
2009-11-27 Marcus Brinkmann <marcus@g10code.de>
|
2009-11-27 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* command.c (start_command_handler): Do not call
|
* command.c (start_command_handler): Do not call
|
||||||
|
@ -361,13 +361,14 @@ read_trustfiles (void)
|
|||||||
ti = xtryrealloc (table, (tableidx?tableidx:1) * sizeof *table);
|
ti = xtryrealloc (table, (tableidx?tableidx:1) * sizeof *table);
|
||||||
if (!ti)
|
if (!ti)
|
||||||
{
|
{
|
||||||
|
err = gpg_error_from_syserror ();
|
||||||
xfree (table);
|
xfree (table);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock_trusttable ();
|
lock_trusttable ();
|
||||||
xfree (trusttable);
|
xfree (trusttable);
|
||||||
trusttable = table;
|
trusttable = ti;
|
||||||
trusttablesize = tableidx;
|
trusttablesize = tableidx;
|
||||||
unlock_trusttable ();
|
unlock_trusttable ();
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user