Remove unused DbusError to avoid memory leak. 80/207880/1
authorGaurav Gupta <g.gupta@samsung.com>
Thu, 13 Jun 2019 10:57:07 +0000 (16:27 +0530)
committerGaurav Gupta <g.gupta@samsung.com>
Thu, 13 Jun 2019 11:13:03 +0000 (16:43 +0530)
commitacedf6f40d6eaa405ac6cb390863b0c216e0543a
tree6747e7336be2dcc32a61ec2a4b23ff0802ff7e63
parent4afc3d948a181b0eab55436b22f72ba5d33d8efb
Remove unused DbusError to avoid memory leak.

Pass NULL as error argument to avoid setting error string in dbus_validate_bus_name(), thus avoid possible memory leak.
We expect the name to be valid bus name (utf8) as it is fetched from the connection.
It will also optimize stack usage as "local_error" variable & dbus_error_init() function are called in for loop.

Other fix could be to check free "error" if it is set.
Signed-off-by: Gaurav Gupta <g.gupta@samsung.com>
Reviewed-by: Himanshu Maithani <himanshu.m@samsung.com>
Change-Id: I773211edd76b6591369bbaae5464971894481a28
dbus/dbus-transport-kdbus.c