Commit aef84349 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(read_ranges_precondition): Don't allocate a copy of read_ranges if

	read_ranges is NULL.
parent 3e4e1968
/*
* $Id: membership.c,v 0.85 2003/01/12 19:56:20 ceder Exp $
* $Id: membership.c,v 0.86 2003/03/23 09:45:10 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -1437,10 +1437,13 @@ read_ranges_precondition(Membership *m,
}
*save = *m;
save->read_ranges = smalloc(m->no_of_read_ranges
* sizeof(save->read_ranges[0]));
memcpy(save->read_ranges, m->read_ranges,
m->no_of_read_ranges * sizeof(save->read_ranges[0]));
if (m->read_ranges != NULL)
{
save->read_ranges = smalloc(m->no_of_read_ranges
* sizeof(save->read_ranges[0]));
memcpy(save->read_ranges, m->read_ranges,
m->no_of_read_ranges * sizeof(save->read_ranges[0]));
}
}
static int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment