/*
- * Copyright (C) 2010-2013 jeanfi@gmail.com
+ * Copyright (C) 2010-2016 jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
str = malloc(11);
s = strftime(str, 11, "%Y/%m/%d", tm);
- if (s)
+ if (s) {
return str;
-
- log_err("Failed to convert time");
- return NULL;
+ } else {
+ log_err("Failed to convert time");
+ free(str);
+ return NULL;
+ }
}