mirror of
https://gitlab.com/spectre.app/cli.git
synced 2024-11-01 10:51:44 +01:00
Ensure buffer is set.
This commit is contained in:
parent
a8bad86f37
commit
54c17c793d
1 changed files with 1 additions and 2 deletions
|
@ -805,7 +805,7 @@ void cli_save(Arguments *args, Operation *operation) {
|
|||
|
||||
char *buf = NULL;
|
||||
MPMarshalError marshalError = { .type = MPMarshalSuccess };
|
||||
if (!mpw_marshal_write( &buf, operation->sitesFormat, operation->user, &marshalError ) || marshalError.type != MPMarshalSuccess)
|
||||
if (!mpw_marshal_write( &buf, operation->sitesFormat, operation->user, &marshalError ) || marshalError.type != MPMarshalSuccess || !buf)
|
||||
wrn( "Couldn't encode updated configuration file:\n %s: %s", operation->sitesPath, marshalError.description );
|
||||
|
||||
else if (fwrite( buf, sizeof( char ), strlen( buf ), sitesFile ) != strlen( buf ))
|
||||
|
@ -858,5 +858,4 @@ void cli_masterKeyProvider_free() {
|
|||
__cli_masterKeyProvider_currentAlgorithm = (MPAlgorithmVersion)-1;
|
||||
mpw_free_string( &__cli_masterKeyProvider_currentPassword );
|
||||
__cli_masterKeyProvider_currentOperation = NULL;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue