Permalink
Browse files

Minor cleanup. Fix memory leak in checkdeps(), tweak trans_prepare().

Removes superfluous/unused argument to trans_prepare().
  • Loading branch information...
1 parent 2265f73 commit d6f1fcbf880fff0d695c324bbc93815c5734e2b1 @juster juster committed May 19, 2011
Showing with 6 additions and 5 deletions.
  1. +2 −2 clydelib/sync.lua
  2. +3 −1 lualpm/dep.c
  3. +1 −2 lualpm/trans.c
View
@@ -742,7 +742,7 @@ local function sync_aur_trans(targets)
end
end
- transret, data = alpm.trans_prepare(data)
+ transret, data = alpm.trans_prepare()
if (transret == -1) then
eprintf("LOG_ERROR", g("failed to prepare transaction (%s)\n"), alpm.strerrorlast())
@@ -1274,7 +1274,7 @@ local function sync_trans(targets)
end
end
- transret, data = alpm.trans_prepare(data)
+ transret, data = alpm.trans_prepare()
if (transret == -1) then
eprintf("LOG_ERROR", g("failed to prepare transaction (%s)\n"), alpm.strerrorlast())
View
@@ -54,7 +54,9 @@ int lalpm_checkdeps(lua_State *L)
alpm_list_t *upgrade = lstring_table_to_alpm_list(L, 3);
alpm_list_t *result = alpm_checkdeps(pkglist, reversedeps, remove, upgrade);
alpm_list_to_any_table(L, result, PMPKG_T);
-
+ FREELIST(pkglist);
+ FREELIST(remove);
+ FREELIST(upgrade);
return 1;
}
View
@@ -91,8 +91,7 @@ int lalpm_trans_init ( lua_State *L )
int lalpm_trans_prepare(lua_State *L)
{
- luaL_checktype(L, 1, LUA_TTABLE);
- alpm_list_t *list = lstring_table_to_alpm_list(L, 1);
+ alpm_list_t *list = NULL;
const int result = alpm_trans_prepare(&list);
lua_pushnumber(L, result);
if (result == -1) {

0 comments on commit d6f1fcb

Please sign in to comment.