mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
check return code of asprintf
On ubuntu (gcc 4.9.2), I get: mount.c: In function ‘add_fsname_auto’: mount.c:1414:3: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result] asprintf(&fsauto_names, "%s,%s", old, names); ^ cc1: all warnings being treated as errors Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
2702615286
commit
a052e0b60a
1 changed files with 4 additions and 1 deletions
5
mount.c
5
mount.c
|
|
@ -1411,7 +1411,10 @@ bool add_fsname_auto(const char *names)
|
|||
fsauto_names = xstrdup(names);
|
||||
else {
|
||||
fsauto_names = NULL;
|
||||
asprintf(&fsauto_names, "%s,%s", old, names);
|
||||
if (asprintf(&fsauto_names, "%s,%s", old, names) < 0) {
|
||||
fsauto_names = old;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
xfree(old);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue