Free "engine" resource in case of failure to prevent memory leak
PR: #778 Submitted by: George Mitchell <george@m5p.com>
This commit is contained in:
parent
28474e26f4
commit
d161f5a9b2
@ -1054,14 +1054,17 @@ ENGINE_load_cryptodev(void)
|
|||||||
|
|
||||||
if (engine == NULL)
|
if (engine == NULL)
|
||||||
return;
|
return;
|
||||||
if ((fd = get_dev_crypto()) < 0)
|
if ((fd = get_dev_crypto()) < 0) {
|
||||||
|
ENGINE_free(engine);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find out what asymmetric crypto algorithms we support
|
* find out what asymmetric crypto algorithms we support
|
||||||
*/
|
*/
|
||||||
if (ioctl(fd, CIOCASYMFEAT, &cryptodev_asymfeat) == -1) {
|
if (ioctl(fd, CIOCASYMFEAT, &cryptodev_asymfeat) == -1) {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
ENGINE_free(engine);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user