Commit cc60d193 authored by Max Kellermann's avatar Max Kellermann

Directory: use g_malloc() instead of g_malloc0()

Explicit attribute initialization.
parent 0f99410b
......@@ -44,9 +44,9 @@ Directory::Allocate(const char *path)
const size_t path_size = strlen(path) + 1;
Directory *directory =
(Directory *)g_malloc0(sizeof(*directory)
- sizeof(directory->path)
+ path_size);
(Directory *)g_malloc(sizeof(*directory)
- sizeof(directory->path)
+ path_size);
new(directory) Directory(path);
return directory;
......@@ -61,6 +61,7 @@ Directory::Directory()
}
Directory::Directory(const char *_path)
:mtime(0), have_stat(false)
{
INIT_LIST_HEAD(&children);
INIT_LIST_HEAD(&songs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment