mirror of
https://github.com/openbabel/openbabel.git
synced 2026-08-14 06:54:45 -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)
|
if (!bgn || !end)
|
||||||
{
|
{
|
||||||
obErrorLog.ThrowError(__FUNCTION__, "Unable to add bond - invalid atom index", obDebug);
|
obErrorLog.ThrowError(__FUNCTION__, "Unable to add bond - invalid atom index", obDebug);
|
||||||
|
delete bond;
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
bond->Set(_nbonds,bgn,end,order,flags);
|
bond->Set(_nbonds,bgn,end,order,flags);
|
||||||
|
|||||||
Reference in New Issue
Block a user