connection: fix user quota accounting corruption
authorDjalal Harouni <tixxdz@opendz.org>
Wed, 30 Jul 2014 20:11:57 +0000 (21:11 +0100)
committerKay Sievers <kay@vrfy.org>
Thu, 31 Jul 2014 14:29:59 +0000 (16:29 +0200)
commit1becebff0eafbdb4b04105378c3e4328f1c6509f
treec3fd539fb880eecb5e0ba46db70d409eb0fa490b
parent1ee9fcac431e4d6f71a7667258e343459a13e5c7
connection: fix user quota accounting corruption

First use kzalloc to allocate the users array, so we do not reference
unintialized values.

And free the old conn->msg_users array not the newly allocated 'users'
one.

Patch tested, and users will hit the KDBUS_CONN_MAX_MSGS_PER_USER limit
and fail with -ENOBUFS

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
connection.c