summaryrefslogtreecommitdiff
path: root/ui/recent.h
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-10-04 11:31:19 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2015-10-04 15:45:02 +0000
commitc647faa8a90739963ba40a099a365197f90b2184 (patch)
tree779aa416faca634eb3eb5dcd84e8421a75720ce2 /ui/recent.h
parent49151eb28c421b61a89bd18feb509e9428909b1e (diff)
downloadwireshark-c647faa8a90739963ba40a099a365197f90b2184.tar.gz
Fix various memleaks
Found by starting Wireshark within an empty profile, opening Preferences, search for Protocol "IEEE 802.11" (because it has radio buttons), then close everything again. Many fixes are trivial, but the various recent_read_* functions in recent.c were changed to return a boolean such that the result can always be checked even if errno==0. QButtonGroup leak was hinted by Clang Static Analyzer, all other memleaks were found using ASAN/LSan. Change-Id: Ia73f5d4c09d92f22e72377be59e23342f8ad7211 Reviewed-on: https://code.wireshark.org/review/10776 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/recent.h')
-rw-r--r--ui/recent.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/recent.h b/ui/recent.h
index ef5f357f07..766f5be473 100644
--- a/ui/recent.h
+++ b/ui/recent.h
@@ -123,22 +123,25 @@ extern gboolean write_profile_recent(void);
*
* @param rf_path_return path to recent file if function failed
* @param rf_errno_return if failed
+ * @return TRUE if succeeded, FALSE if failed (check parameters for reason).
*/
-extern void recent_read_static(char **rf_path_return, int *rf_errno_return);
+extern gboolean recent_read_static(char **rf_path_return, int *rf_errno_return);
/** Read profile recent settings file (static part).
*
* @param rf_path_return path to recent file if function failed
* @param rf_errno_return if failed
+ * @return TRUE if succeeded, FALSE if failed (check parameters for reason).
*/
-extern void recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
+extern gboolean recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
/** Read recent settings file (dynamic part).
*
* @param rf_path_return path to recent file if function failed
* @param rf_errno_return if failed
+ * @return TRUE if succeeded, FALSE if failed (check parameters for reason).
*/
-extern void recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
+extern gboolean recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
/**
* Given a -o command line string, parse it and set the recent value in