Skip to content

Commit

Permalink
Minor cleanup. Fix memory leak in checkdeps(), tweak trans_prepare().
Browse files Browse the repository at this point in the history
Removes superfluous/unused argument to trans_prepare().
  • Loading branch information
juster committed May 19, 2011
1 parent 2265f73 commit d6f1fcb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clydelib/sync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion lualpm/dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 1 addition & 2 deletions lualpm/trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d6f1fcb

Please sign in to comment.