aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2008-02-26 18:58:12 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2008-02-26 18:58:12 +0000
commit9fdc3e961d7b6c0731ad218095961763428a1baf (patch)
tree30b444d7a2296f0b4f5db3fce7b96aefab6f583f /epan
parentc5e560d530fb6513ed1e0a63382661fa7dc07647 (diff)
get_datafile_path() and get_persconffile_path() return malloc'd memory. Note that in the comments.
svn path=/trunk/; revision=24476
Diffstat (limited to 'epan')
-rw-r--r--epan/filesystem.c12
-rw-r--r--epan/filesystem.h6
2 files changed, 15 insertions, 3 deletions
diff --git a/epan/filesystem.c b/epan/filesystem.c
index 86c37b5f05..43f2f62f5e 100644
--- a/epan/filesystem.c
+++ b/epan/filesystem.c
@@ -790,7 +790,7 @@ set_profile_name(const gchar *profilename)
g_free (persconfprofile);
}
- if (profilename && strlen(profilename) > 0 &&
+ if (profilename && strlen(profilename) > 0 &&
strcmp(profilename, DEFAULT_PROFILE) != 0) {
persconfprofile = g_strdup (profilename);
} else {
@@ -929,7 +929,7 @@ get_persconffile_dir(const gchar *profilename)
if (profilename && strlen(profilename) > 0 &&
strcmp(profilename, DEFAULT_PROFILE) != 0) {
- persconffile_profile_dir = g_strdup_printf ("%s%s%s", get_profiles_dir (),
+ persconffile_profile_dir = g_strdup_printf ("%s%s%s", get_profiles_dir (),
G_DIR_SEPARATOR_S, profilename);
} else {
persconffile_profile_dir = g_strdup_printf (get_persconffile_dir_no_profile ());
@@ -958,7 +958,7 @@ delete_directory (const char *directory, char **pf_dir_path_return)
if ((dir = eth_dir_open(directory, 0, NULL)) != NULL) {
while ((file = eth_dir_read_name(dir)) != NULL) {
- filename = g_strdup_printf ("%s%s%s", directory, G_DIR_SEPARATOR_S,
+ filename = g_strdup_printf ("%s%s%s", directory, G_DIR_SEPARATOR_S,
eth_dir_get_name(file));
if (test_for_directory(filename) != EISDIR) {
ret = eth_remove(filename);
@@ -1223,6 +1223,9 @@ get_home_dir(void)
* subdirectory of the user's home directory, and check whether that
* exists; if it does, we return that, so that configuration files
* from earlier versions can be read.
+ *
+ * The returned file name was g_malloc()'d so it must be g_free()d when the
+ * caller is done with it.
*/
char *
get_persconffile_path(const char *filename, gboolean from_profile, gboolean for_writing
@@ -1330,6 +1333,9 @@ filesystem_opt(int opt _U_, const char *optarg)
/*
* Construct the path name of a global configuration file, given the
* file name.
+ *
+ * The returned file name was g_malloc()'d so it must be g_free()d when the
+ * caller is done with it.
*/
char *
get_datafile_path(const char *filename)
diff --git a/epan/filesystem.h b/epan/filesystem.h
index 42bf4f8906..9f7de24b90 100644
--- a/epan/filesystem.h
+++ b/epan/filesystem.h
@@ -65,6 +65,9 @@ extern const char *get_datafile_dir(void);
/*
* Construct the path name of a global configuration file, given the
* file name.
+ *
+ * The returned file name was g_malloc()'d so it must be g_free()d when the
+ * caller is done with it.
*/
extern char *get_datafile_path(const char *filename);
@@ -144,6 +147,9 @@ extern int create_persconffile_dir(char **pf_dir_path_return);
* subdirectory of the user's home directory, and check whether that
* exists; if it does, we return that, so that configuration files
* from earlier versions can be read.
+ *
+ * The returned file name was g_malloc()'d so it must be g_free()d when the
+ * caller is done with it.
*/
extern char *get_persconffile_path(const char *filename, gboolean from_profile,
gboolean for_writing);