To avoid memory leak issue allocate memory to tethering structure
after all error checks.
Change-Id: If10578acce2eb8eedbdbc96f73a30c79c1a7a125
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
struct connman_technology *technology, const char *bridge,
bool enabled)
{
- struct tethering_info *tethering = g_new0(struct tethering_info, 1);
+ struct tethering_info *tethering;
GDBusProxy *proxy;
const char *method;
bool result;
if (!proxy)
return false;
+ tethering = g_new0(struct tethering_info, 1);
+
tethering->technology = technology;
tethering->bridge = g_strdup(bridge);
tethering->enable = enabled;