mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-30 00:13:43 +02:00
cli_classic.c: Prevent memory leak
If the `--flash-contents` switch is specified more than once, it will result in a memory leak. Therefore, allow this option only once. Change-Id: I530933c9a6431580fe4645396bb363939472a80a Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/39972 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
f572b50ec7
commit
e0fac2e4a6
@ -273,6 +273,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
break;
|
||||
case OPTION_FLASH_CONTENTS:
|
||||
if (referencefile)
|
||||
cli_classic_abort_usage("Error: --flash-contents specified more than once."
|
||||
"Aborting.\n");
|
||||
referencefile = strdup(optarg);
|
||||
break;
|
||||
case OPTION_FLASH_NAME:
|
||||
|
Loading…
x
Reference in New Issue
Block a user