Skip to content

Commit

Permalink
check asprintf() return value
Browse files Browse the repository at this point in the history
  • Loading branch information
bachradsusi committed Jan 25, 2024
1 parent 6440874 commit 5b90be8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sandbox/seunshare.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,14 @@ int main(int argc, char **argv) {
goto childerr;
}

asprintf(&pipewire_path_s, "%s/%s", runuserdir_s, "pipewire-0");
asprintf(&pipewire_path, "%s/pipewire-0", RUNTIME_DIR);
if (asprintf(&pipewire_path_s, "%s/%s", runuserdir_s, "pipewire-0") == -1) {
perror(_("Out of memory"));
goto childerr;
}
if (asprintf(&pipewire_path, "%s/pipewire-0", RUNTIME_DIR) == -1) {
perror(_("Out of memory"));
goto childerr;
}
seunshare_mount_file(pipewire_path, pipewire_path_s);
}

Expand Down

0 comments on commit 5b90be8

Please sign in to comment.