aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-06-12 17:35:34 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-06-12 17:35:34 +0530
commita5c7fde56bda1ab57646438598cb9fb0240fd260 (patch)
tree358ecc9acc1240f684c4cfa405a827ec7392baf5
parentb5ce444caac703dcfab761b62edf77a3e8fbd418 (diff)
filehandler: asprintf into m_path
-rw-r--r--src/filehandler.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/filehandler.cc b/src/filehandler.cc
index 915657e..d774487 100644
--- a/src/filehandler.cc
+++ b/src/filehandler.cc
@@ -7,7 +7,7 @@ Filehandler::init(char *path)
{
m_file = NULL;
m_buffer = NULL;
- m_path = path;
+ asprintf(&m_path, "%s", path);
}
bool
@@ -53,4 +53,5 @@ Filehandler::close(void)
{
fclose(m_file);
free(m_buffer);
+ free(m_path);
}