Do not pass NULL pointer to copyout in if_clone_list.
Sometimes caller is only interested in how many clones are there and NULL pointer is passed for the destination buffer. Do not pass it to copyout then.
This commit is contained in:
parent
5f943cca65
commit
92f19df431
@ -508,7 +508,7 @@ if_clone_list(struct if_clonereq *ifcr)
|
||||
|
||||
done:
|
||||
IF_CLONERS_UNLOCK();
|
||||
if (err == 0)
|
||||
if (err == 0 && dst != NULL)
|
||||
err = copyout(outbuf, dst, buf_count*IFNAMSIZ);
|
||||
if (outbuf != NULL)
|
||||
free(outbuf, M_CLONE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user