[LINUXWRT-110][CID: 44006] Prevent fixes.
authorZbigniew Kostrzewa <z.kostrzewa@samsung.com>
Tue, 19 Feb 2013 12:27:51 +0000 (13:27 +0100)
committerZbigniew Kostrzewa <z.kostrzewa@samsung.com>
Wed, 20 Feb 2013 06:51:25 +0000 (07:51 +0100)
[Issue#] N/A
[Problem] Pointer set to NULL passed to dlsym.
[Cause] N/A
[Solution] Fixed.
[Verification] successful build, restart wrt-launchpad-deamon.
No logical difference in working of wrt-launchpad-deamon.

Change-Id: Ia0b834edd416a3751ea5042872f41299d1b95750

src/wrt-launchpad-daemon/legacy/preload.h

index 7baf625..a2da81b 100644 (file)
@@ -40,7 +40,6 @@ typedef struct handle_list_t {
 
 static inline void __preload_init(int argc, char **argv)
 {
-    void *handle = NULL;
     char soname[MAX_LOCAL_BUFSZ] = { 0, };
     FILE *preload_list;
     int (*func)() = NULL;
@@ -82,7 +81,7 @@ static inline void __preload_init(int argc, char **argv)
         if (func != NULL) {
             _D("get pre-initialization function\n");
             entry->dl_einit = func;
-            func = dlsym(handle, EFL_SHUTDOWN_FUNC);
+            func = dlsym(entry->handle, EFL_SHUTDOWN_FUNC);
             if (func != NULL) {
                 _D("get shutdown function\n");
                 entry->dl_efini = func;