mirror of
https://github.com/openbabel/openbabel.git
synced 2026-08-09 12:38:03 -05:00
Fix bug with AddBond on garbage input - check before allocating
Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
This commit is contained in:
@@ -2561,6 +2561,7 @@ namespace OpenBabel
|
||||
if (!bgn || !end)
|
||||
{
|
||||
obErrorLog.ThrowError(__FUNCTION__, "Unable to add bond - invalid atom index", obDebug);
|
||||
delete bond;
|
||||
return(false);
|
||||
}
|
||||
bond->Set(_nbonds,bgn,end,order,flags);
|
||||
|
||||
Reference in New Issue
Block a user