Fix null pointer check accidentally disabled (#796293)

Compiling (with new enough g++) produces this warning:

    PasswordRAMStore.cc: In member function 'void GParted::PWStore::erase_all()':
    PasswordRAMStore.cc:177:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
      if ( protected_mem != NULL );
      ^~
    PasswordRAMStore.cc:193:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
       memset( protected_mem, '\0', ProtectedMemSize );
       ^~~~~~

Looks like a stray semicolon...

Bug 796293 - Fix null pointer check accidentally disabled
This commit is contained in:
Robert Ancell 2018-05-21 14:20:54 +12:00 committed by Mike Fleetwood
parent 387aecff42
commit 2d853b46c1
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ PWStore::iterator PWStore::find_key( const Glib::ustring & key )
void PWStore::erase_all()
{
pw_entries.clear();
if ( protected_mem != NULL );
if ( protected_mem != NULL )
// WARNING:
// memset() can be optimised away if the compiler knows the memory is not
// accessed again. In this case this memset() is in a separate method