Browse Source

plugins: Fixes a issue when dlsym failed, the handle not closed

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20201001163429.1348-2-luoyonggang@gmail.com>
Message-Id: <20201007160038.26953-20-alex.bennee@linaro.org>
Yonggang Luo 4 years ago
parent
commit
b31371004f
1 changed files with 1 additions and 0 deletions
  1. 1 0
      plugins/loader.c

+ 1 - 0
plugins/loader.c

@@ -235,6 +235,7 @@ static int plugin_load(struct qemu_plugin_desc *desc, const qemu_info_t *info)
     return rc;
     return rc;
 
 
  err_symbol:
  err_symbol:
+    g_module_close(ctx->handle);
  err_dlopen:
  err_dlopen:
     qemu_vfree(ctx);
     qemu_vfree(ctx);
     return 1;
     return 1;