obexd: Fix memory leak when loading plugins 85/204985/1
authorSahil Pai <sahil.pai1@samsung.com>
Thu, 3 May 2018 12:05:38 +0000 (17:35 +0530)
committerAmit Purwar <amit.purwar@samsung.com>
Mon, 29 Apr 2019 04:05:11 +0000 (09:35 +0530)
commit3e1a7c201759ca648ca32916fa9f9e963ae13324
treeb7b533910e0c9ecc3957c0bd5dee5c4d4d3bb831
parentb2b2d64c81ac0c109233f6356fe9c4b023fb8c37
obexd: Fix memory leak when loading plugins

On failure to open plugin directory, memory allocated to 'patterns'
and 'excludes' is not being freed, and the following memory leak is
logged:

Direct leak of 28 byte(s) in 1 object(s) allocated from:
    #0 0xb6aa1c49 in malloc (/usr/lib/liblsan.so+0x9c49)
    #1 0xb6976e89 in g_malloc (/lib/libglib-2.0.so.0+0x3ae89)
    #2 0xb69886f1 in g_strsplit_set (/lib/libglib-2.0.so.0+0x4c6f1)
    #3 0xb6f82f3b in plugin_init (/usr/libexec/bluetooth/obexd+0x20f3b)
    #4 0xb6f70dc9 in main (/usr/libexec/bluetooth/obexd+0xedc9)

Change-Id: I9c930ba8fcd4cd04a25f4329ee02c5696c19cf39
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
obexd/src/plugin.c