projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
700eddf
)
stats: Fix double free error
author
Grant Erickson
<marathon96@gmail.com>
Mon, 31 Jan 2011 14:56:54 +0000
(15:56 +0100)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Mon, 31 Jan 2011 14:56:54 +0000
(15:56 +0100)
The error appears when stats_file_remap() fails.
src/stats.c
patch
|
blob
|
history
diff --git
a/src/stats.c
b/src/stats.c
index
0dc45f0
..
929e09b
100644
(file)
--- a/
src/stats.c
+++ b/
src/stats.c
@@
-222,10
+222,18
@@
static void stats_free(gpointer user_data)
TFR(close(file->fd));
file->fd = -1;
- if (file->history_name != NULL)
+ if (file->history_name != NULL)
{
g_free(file->history_name);
- g_free(file->name);
- g_free(file);
+ file->history_name = NULL;
+ }
+
+ if (file->name != NULL) {
+ g_free(file->name);
+ file->name = NULL;
+ }
+
+ if (file != NULL)
+ g_free(file);
}
static void update_first(struct stats_file *file)