Directory: use g_malloc() instead of g_malloc0()
Explicit attribute initialization.
This commit is contained in:
parent
0f99410ba1
commit
cc60d193ce
@ -44,9 +44,9 @@ Directory::Allocate(const char *path)
|
|||||||
|
|
||||||
const size_t path_size = strlen(path) + 1;
|
const size_t path_size = strlen(path) + 1;
|
||||||
Directory *directory =
|
Directory *directory =
|
||||||
(Directory *)g_malloc0(sizeof(*directory)
|
(Directory *)g_malloc(sizeof(*directory)
|
||||||
- sizeof(directory->path)
|
- sizeof(directory->path)
|
||||||
+ path_size);
|
+ path_size);
|
||||||
new(directory) Directory(path);
|
new(directory) Directory(path);
|
||||||
|
|
||||||
return directory;
|
return directory;
|
||||||
@ -61,6 +61,7 @@ Directory::Directory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Directory::Directory(const char *_path)
|
Directory::Directory(const char *_path)
|
||||||
|
:mtime(0), have_stat(false)
|
||||||
{
|
{
|
||||||
INIT_LIST_HEAD(&children);
|
INIT_LIST_HEAD(&children);
|
||||||
INIT_LIST_HEAD(&songs);
|
INIT_LIST_HEAD(&songs);
|
||||||
|
Loading…
Reference in New Issue
Block a user