crypto/x509v3/v3_info.c:200: error: USE_AFTER_FREE
  call to `sk_ACCESS_DESCRIPTION_pop_free()` eventually accesses memory that was invalidated by call to `free()` on line 164 indirectly during the call to `sk_ACCESS_DESCRIPTION_push()`.
Showing all 22 steps of the trace


crypto/x509v3/v3_info.c:157:18: invalidation part of the trace starts here
155.       char *objtmp, *ptmp;
156.   
157.       if ((ainfo = sk_ACCESS_DESCRIPTION_new_null()) == NULL) {
                        ^
158.           X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
159.           return NULL;

crypto/x509v3/v3_info.c:157:18: passed as argument to `sk_ACCESS_DESCRIPTION_new_null`
  155.       char *objtmp, *ptmp;
  156.   
  157.       if ((ainfo = sk_ACCESS_DESCRIPTION_new_null()) == NULL) {
                          ^
  158.           X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
  159.           return NULL;

crypto/x509v3/v3_info.c:157:18: return from call to `sk_ACCESS_DESCRIPTION_new_null`
  155.       char *objtmp, *ptmp;
  156.   
  157.       if ((ainfo = sk_ACCESS_DESCRIPTION_new_null()) == NULL) {
                          ^
  158.           X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
  159.           return NULL;

crypto/x509v3/v3_info.c:157:10: assigned
  155.       char *objtmp, *ptmp;
  156.   
  157.       if ((ainfo = sk_ACCESS_DESCRIPTION_new_null()) == NULL) {
                  ^
  158.           X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
  159.           return NULL;

crypto/x509v3/v3_info.c:164:17: when calling `sk_ACCESS_DESCRIPTION_push` here
  162.           cnf = sk_CONF_VALUE_value(nval, i);
  163.           if ((acc = ACCESS_DESCRIPTION_new()) == NULL
  164.               || !sk_ACCESS_DESCRIPTION_push(ainfo, acc)) {
                         ^
  165.               X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS,
  166.                         ERR_R_MALLOC_FAILURE);

include/openssl/x509v3.h:223:1: parameter `sk` of sk_ACCESS_DESCRIPTION_push
    221.   DEFINE_STACK_OF(GENERAL_NAMES)
    222.   
    223. > DEFINE_STACK_OF(ACCESS_DESCRIPTION)
    224.   
    225.   typedef struct DIST_POINT_NAME_st {

include/openssl/x509v3.h:223:1: when calling `sk_push` here
    221.   DEFINE_STACK_OF(GENERAL_NAMES)
    222.   
    223. > DEFINE_STACK_OF(ACCESS_DESCRIPTION)
    224.   
    225.   typedef struct DIST_POINT_NAME_st {

crypto/stack/stack.c:258:1: parameter `st` of sk_push
      256.   }
      257.   
      258. > int sk_push(_STACK *st, void *data)
      259.   {
      260.       return (sk_insert(st, data, st->num));

crypto/stack/stack.c:260:13: when calling `sk_insert` here
      258.   int sk_push(_STACK *st, void *data)
      259.   {
      260.       return (sk_insert(st, data, st->num));
                         ^
      261.   }
      262.   

crypto/stack/stack.c:166:1: parameter `st` of sk_insert
        164.   }
        165.   
        166. > int sk_insert(_STACK *st, void *data, int loc)
        167.   {
        168.       char **s;

crypto/stack/stack.c:173:13: when calling `CRYPTO_realloc` here
        171.           return 0;
        172.       if (st->num_alloc <= st->num + 1) {
        173.           s = OPENSSL_realloc((char *)st->data,
                           ^
        174.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);
        175.           if (s == NULL)

crypto/mem.c:165:1: parameter `str` of CRYPTO_realloc
          163.   }
          164.   
          165. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
          166.   {
          167.       if (str == NULL)

crypto/mem.c:171:9: when calling `CRYPTO_free` here
          169.   
          170.       if (num == 0) {
          171.           CRYPTO_free(str);
                         ^
          172.           return NULL;
          173.       }

crypto/mem.c:233:1: parameter `str` of CRYPTO_free
            231.   }
            232.   
            233. > void CRYPTO_free(void *str)
            234.   {
            235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: was invalidated by call to `free()`
            242.       }
            243.   #else
            244.       free(str);
                       ^
            245.   #endif
            246.   }

crypto/x509v3/v3_info.c:157:18: use-after-lifetime part of the trace starts here
155.       char *objtmp, *ptmp;
156.   
157.       if ((ainfo = sk_ACCESS_DESCRIPTION_new_null()) == NULL) {
                        ^
158.           X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
159.           return NULL;

crypto/x509v3/v3_info.c:157:18: passed as argument to `sk_ACCESS_DESCRIPTION_new_null`
  155.       char *objtmp, *ptmp;
  156.   
  157.       if ((ainfo = sk_ACCESS_DESCRIPTION_new_null()) == NULL) {
                          ^
  158.           X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
  159.           return NULL;

crypto/x509v3/v3_info.c:157:18: return from call to `sk_ACCESS_DESCRIPTION_new_null`
  155.       char *objtmp, *ptmp;
  156.   
  157.       if ((ainfo = sk_ACCESS_DESCRIPTION_new_null()) == NULL) {
                          ^
  158.           X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
  159.           return NULL;

crypto/x509v3/v3_info.c:157:10: assigned
  155.       char *objtmp, *ptmp;
  156.   
  157.       if ((ainfo = sk_ACCESS_DESCRIPTION_new_null()) == NULL) {
                  ^
  158.           X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS, ERR_R_MALLOC_FAILURE);
  159.           return NULL;

crypto/x509v3/v3_info.c:200:5: when calling `sk_ACCESS_DESCRIPTION_pop_free` here
  198.       return ainfo;
  199.    err:
  200.       sk_ACCESS_DESCRIPTION_pop_free(ainfo, ACCESS_DESCRIPTION_free);
             ^
  201.       return NULL;
  202.   }

crypto/mem.c:233:1: parameter `str` of CRYPTO_free
    231.   }
    232.   
    233. > void CRYPTO_free(void *str)
    234.   {
    235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: invalid access occurs here
    242.       }
    243.   #else
    244.       free(str);
               ^
    245.   #endif
    246.   }
