1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

lib:socket: If returning early, set ifaces

Prevents a segfault in load_interfaces() when total interfaces == 1.
Fixes regression caused by da68a1b2f417ec82ea4ed3e7a4d867cef8ca8f93.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13665

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Oct 28 00:35:35 CEST 2018 on sn-devel-144
This commit is contained in:
David Mulder 2018-10-24 10:55:02 -06:00 committed by Volker Lendecke
parent 94f8a690f6
commit 5391e21dea

View File

@ -363,12 +363,13 @@ static int iface_comp(struct iface_struct *i1, struct iface_struct *i2)
above */
int get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces)
{
struct iface_struct *ifaces;
struct iface_struct *ifaces = NULL;
int total, i, j;
total = _get_interfaces(mem_ctx, &ifaces);
/* If we have an error, no interface or just one we can leave */
if (total <= 1) {
*pifaces = ifaces;
return total;
}