summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Sumita <hsumita@chromium.org>2012-07-10 11:38:47 +0900
committerHiroshi Sumita <hsumita@chromium.org>2012-07-10 11:38:47 +0900
commit8aaa87b47115a8383cd556100bc30ffc70791208 (patch)
tree9bcf376b17d811452db3a163e8898c8f4e6a0f7c
parent810a16c983eb9639c113e2b275b7a0ec62171417 (diff)
downloadpyzy-8aaa87b47115a8383cd556100bc30ffc70791208.tar.gz
Fixes memory leak.
BUG=Memory leak on InputContext::init (). TEST=Manual. Review URL: https://codereview.appspot.com/6349073
-rw-r--r--src/InputContext.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/InputContext.cc b/src/InputContext.cc
index d855cb4..e0dfe2e 100644
--- a/src/InputContext.cc
+++ b/src/InputContext.cc
@@ -34,11 +34,14 @@ namespace PyZy {
void
InputContext::init ()
{
- const std::string cache_dir =
+ char *cache_dir =
g_build_filename (g_get_user_cache_dir (), "pyzy", NULL);
- const std::string config_dir =
+ char *config_dir =
g_build_filename (g_get_user_config_dir (), "pyzy", NULL);
init (cache_dir, config_dir);
+
+ g_free (cache_dir);
+ g_free (config_dir);
}
void
InputContext::init (const std::string & user_cache_dir,