wmail: fixed NULL-pointer dereference if opendir(3) fails.

Code was:

  if (( dir = opendir( ... )))
  {
    // ...
  }
  closedir( dir ); // dir may be NULL

Moved closedir(3) inside if-block.
This commit is contained in:
Jeremy Sowden 2019-06-21 11:50:31 +01:00 committed by Carlos R. Mafra
parent 2ae0c7cba4
commit 40d7eb504c

View file

@ -981,9 +981,9 @@ static int TraverseDirectory( const char *name, bool isNewMail )
}
free( fullName );
}
}
closedir( dir );
closedir( dir );
}
return mails;
}