mufs: fix Valgrind warnings in mufs_abspath() by using calloc() instead of malloc()
This commit is contained in:
parent
842ee06ee1
commit
13918141c7
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,10 @@ char *mufs_abspath(const char *path)
|
|||
{
|
||||
char *s, *p, *next, *prev;
|
||||
|
||||
if (!(s = malloc(strlen(path) + 2)))
|
||||
if (!path)
|
||||
return "/";
|
||||
|
||||
if (!(s = calloc(strlen(path) + 2, sizeof *s)))
|
||||
return NULL;
|
||||
|
||||
strcpy(s, path);
|
||||
|
|
Loading…
Add table
Reference in a new issue