*/
input_buffer = (u_char *)malloc(buffer_size);
if (input_buffer == NULL) {
+ EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
"can't allocate memory for encrypted data buffer");
- EVP_CIPHER_CTX_free(ctx);
- return 0;
}
/*
* Copy the input data to the encrypted data buffer, and pad it
*/
output_buffer = (u_char *)malloc(buffer_size);
if (output_buffer == NULL) {
- (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
- "can't allocate memory for decryption buffer");
free(input_buffer);
EVP_CIPHER_CTX_free(ctx);
- return 0;
+ (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
+ "can't allocate memory for decryption buffer");
}
EVP_Cipher(ctx, output_buffer, input_buffer, len);
EVP_CIPHER_CTX_free(ctx);
*/
input_buffer = (u_char *)malloc(buffer_size);
if (input_buffer == NULL) {
+ EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
"esp_print: can't allocate memory for encrypted data buffer");
- EVP_CIPHER_CTX_free(ctx);
- return 0;
}
/*
* Copy the input data to the encrypted data buffer,
*/
output_buffer = (u_char *)malloc(buffer_size);
if (output_buffer == NULL) {
- (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
- "esp_print: can't allocate memory for decryption buffer");
free(input_buffer);
EVP_CIPHER_CTX_free(ctx);
- return -1;
+ (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
+ "esp_print: can't allocate memory for decryption buffer");
}
EVP_Cipher(ctx, output_buffer, input_buffer, len);