Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ main(int argc, char **argv)
sysfatal("dirstat .git: %r");
username = strdup(d->uid);
groupname = strdup(d->gid);
if(username == nil || groupname == nil)
sysfatal("strdup: memory allocation failed");
free(d);

branches = emalloc(sizeof(char*));
Expand Down
3 changes: 2 additions & 1 deletion log.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ filteradd(Pfilt *pf, char *path)
p = smprint("%.*s", (int)(e - path), path);
else
p = strdup(path);

if(p == nil)
sysfatal("Memory allocation failed");
while(e != nil && *e == '/')
e++;
for(i = 0; i < pf->nsub; i++){
Expand Down
2 changes: 2 additions & 0 deletions save.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ main(int argc, char **argv)
idx[nidx].mode = strtol(parts[2], nil, 8);
idx[nidx].path = strdup(parts[3]);
idx[nidx].order = nidx;
if(idx[nidx].path == nil)
sysfatal("strdup: memory allocation failed");
nidx++;
free(ln);
}
Expand Down
4 changes: 4 additions & 0 deletions walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ reporel(char *s)
s = strdup(s);
else
s = smprint("%s/%s", wdirpath, s);
if(s == nil)
sysfatal("smprint or memory allocation failed: %r");
p = cleanname(s);
n = strlen(repopath);
if(strncmp(s, repopath, n) != 0)
Expand Down Expand Up @@ -462,6 +464,8 @@ main(int argc, char **argv)
idx[nidx].mode = strtol(parts[2], nil, 8);
idx[nidx].path = strdup(parts[3]);
idx[nidx].order = nidx;
if(idx[nidx].path == nil)
sysfatal("strdup: memory allocation failed");
nidx++;
free(ln);
}
Expand Down