In case of errors in this function, the allocated context was not properly freed in several cases. Signed-off-by: Marton Balint <cus@passwd.hu> (cherry picked from commit 8e76c99301)
8e76c99301