From cba5856b24fd8028a1c8423d58020b40dc52bb82 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Thu, 5 Nov 2020 13:43:14 +0900 Subject: [PATCH] Fix wrong free Change-Id: Ib92e807989abc80304dcc3c92258e2b3c999a275 Signed-off-by: Changgyu Choi --- src/stub.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stub.cc b/src/stub.cc index 0c22e5e..416e7e7 100644 --- a/src/stub.cc +++ b/src/stub.cc @@ -564,14 +564,14 @@ extern "C" EXPORT_API int bundle_export_to_argv(bundle* b, char*** argv) { exported_argv[idx] = strdup(exported_vt[idx].c_str()); if (exported_argv[idx] == nullptr) { set_last_result(BUNDLE_ERROR_OUT_OF_MEMORY); - bundle_free_exported_argv(argc, &exported_argv); + bundle_free_exported_argv(idx + 1, &exported_argv); return -1; } exported_argv[idx + 1] = strdup(exported_vt[idx + 1].c_str()); if (exported_argv[idx + 1] == nullptr) { set_last_result(BUNDLE_ERROR_OUT_OF_MEMORY); - bundle_free_exported_argv(argc, &exported_argv); + bundle_free_exported_argv(idx + 2, &exported_argv); return -1; } } -- 2.7.4