mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
s3/utils: Check return of talloc_strdup
followup to e82699fcca
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15205
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
19eb88bc53
commit
972127dadd
@ -1149,8 +1149,16 @@ int main(int argc, const char **argv)
|
||||
|
||||
poptGetArg(pc); /* Drop argv[0], the program name */
|
||||
|
||||
if (user_name == NULL)
|
||||
user_name = talloc_strdup(frame, poptGetArg(pc));
|
||||
if (user_name == NULL) {
|
||||
if (poptPeekArg(pc)) {
|
||||
user_name = talloc_strdup(frame, poptGetArg(pc));
|
||||
if (user_name == NULL) {
|
||||
fprintf(stderr, "out of memory\n");
|
||||
TALLOC_FREE(frame);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setparms = (backend ? BIT_BACKEND : 0) +
|
||||
(verbose ? BIT_VERBOSE : 0) +
|
||||
|
Loading…
Reference in New Issue
Block a user