1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

Fix a memleak in irpc_remove_name

First, even when length==0 tdb_fetch might return something. Second, for some
weird reason there might be less data than necessary for a single server id.
This commit is contained in:
Volker Lendecke
2008-05-19 15:53:09 +02:00
parent cc07bd86e2
commit 49b04ca7aa

View File

@ -1085,8 +1085,14 @@ void irpc_remove_name(struct messaging_context *msg_ctx, const char *name)
return;
}
rec = tdb_fetch_bystring(t->tdb, name);
if (rec.dptr == NULL) {
tdb_unlock_bystring(t->tdb, name);
talloc_free(t);
return;
}
count = rec.dsize / sizeof(struct server_id);
if (count == 0) {
free(rec.dptr);
tdb_unlock_bystring(t->tdb, name);
talloc_free(t);
return;