Browse Source

Merge pull request #162 from que273/master

app_lua: Fix memory leak in sr.modf
Hugh Waite 10 years ago
parent
commit
4a480ba974
1 changed files with 5 additions and 0 deletions
  1. 5 0
      modules/app_lua/app_lua_sr.c

+ 5 - 0
modules/app_lua/app_lua_sr.c

@@ -265,6 +265,11 @@ static int lua_sr_modf (lua_State *L)
 		}
 	}
 	pkg_free(act);
+	for(i=0; i<MAX_ACTIONS; i++)
+	{
+		if(argv[i]!=NULL) pkg_free(argv[i]);
+		argv[i] = 0;
+	}
 	lua_pushinteger(L, ret);
 	return 1;