$NetBSD: patch-ba,v 1.1.1.1 2005/01/02 02:51:43 cube Exp $ --- pppd/tdb.c.orig 2004-11-13 08:13:07.000000000 +0100 +++ pppd/tdb.c @@ -193,6 +193,8 @@ void tdb_set_lock_alarm(sig_atomic_t *pa palarm_fired = palarm; } +static int tdb_update_hash __P((TDB_CONTEXT *, TDB_DATA, u32, TDB_DATA)); + /* a byte range locking function - return 0 on success this functions locks/unlocks 1 byte at the specified offset. @@ -800,9 +802,13 @@ static int tdb_expand(TDB_CONTEXT *tdb, tdb->map_size += size; - if (tdb->flags & TDB_INTERNAL) - tdb->map_ptr = realloc(tdb->map_ptr, tdb->map_size); - else { + if (tdb->flags & TDB_INTERNAL) { + void *n; + n = realloc(tdb->map_ptr, tdb->map_size); + if (!n) + goto fail; + tdb->map_ptr = n; + } else { /* * We must ensure the file is remapped before adding the space * to ensure consistency with systems like OpenBSD where