Skip to content

Instantly share code, notes, and snippets.

@ice799
Created April 11, 2014 20:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ice799/10498874 to your computer and use it in GitHub Desktop.
Save ice799/10498874 to your computer and use it in GitHub Desktop.
/* gcc hi.c -o hi -lcrypto */
#include <stdlib.h>
#include <stdio.h>
#include <openssl/crypto.h>
int
main(int argc, char *argv[])
{
void *(*openssl_malloc)(size_t), (*openssl_free)(void *);
CRYPTO_get_mem_functions(&openssl_malloc, NULL, &openssl_free);
printf("system malloc: %p system free: %p\n", malloc, free);
printf("openssl malloc: %p openssl free: %p\n", openssl_malloc,
openssl_free);
return 0;
}
system malloc: 0x7fff8f3f8252 system free: 0x7fff8f3f7ee4
openssl malloc: 0x7fff8f3f8252 openssl free: 0x7fff8f3f7ee4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment