X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fstats.c;h=929e09bf51c8764fe7610da837443ceeb07059b1;hb=268f4a8f7e81d8b32591e01b6dbcdca0bee1322f;hp=0dc45f063683194ce63923dee1d9455235b0f22d;hpb=700eddf5224b0826ffb58aa90813e7fc503534a4;p=framework%2Fconnectivity%2Fconnman.git diff --git a/src/stats.c b/src/stats.c index 0dc45f0..929e09b 100644 --- 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)