crypto/property/property_parse.c:425: error: USE_AFTER_FREE
  call to `sk_PROPERTY_DEFINITION_pop_free()` eventually accesses memory that was invalidated by call to `free()` on line 412 indirectly during the call to `sk_PROPERTY_DEFINITION_push()`.
Showing all 24 steps of the trace


crypto/property/property_parse.c:377:28: invalidation part of the trace starts here
375.       int done;
376.   
377.       if (s == NULL || (sk = sk_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
                                  ^
378.           return NULL;
379.   

crypto/property/property_parse.c:377:28: passed as argument to `sk_PROPERTY_DEFINITION_new`
  375.       int done;
  376.   
  377.       if (s == NULL || (sk = sk_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
                                    ^
  378.           return NULL;
  379.   

crypto/property/property_parse.c:377:28: return from call to `sk_PROPERTY_DEFINITION_new`
  375.       int done;
  376.   
  377.       if (s == NULL || (sk = sk_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
                                    ^
  378.           return NULL;
  379.   

crypto/property/property_parse.c:377:23: assigned
  375.       int done;
  376.   
  377.       if (s == NULL || (sk = sk_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
                               ^
  378.           return NULL;
  379.   

crypto/property/property_parse.c:412:14: when calling `sk_PROPERTY_DEFINITION_push` here
  410.   
  411.   skip_value:
  412.           if (!sk_PROPERTY_DEFINITION_push(sk, prop))
                      ^
  413.               goto err;
  414.           prop = NULL;

crypto/property/property_parse.c:48:1: parameter `sk` of sk_PROPERTY_DEFINITION_push
    46.   static OSSL_PROPERTY_IDX ossl_property_true, ossl_property_false;
    47.   
    48. > DEFINE_STACK_OF(PROPERTY_DEFINITION)
    49.   
    50.   static const char *skip_space(const char *s)

crypto/property/property_parse.c:48:1: when calling `OPENSSL_sk_push` here
    46.   static OSSL_PROPERTY_IDX ossl_property_true, ossl_property_false;
    47.   
    48. > DEFINE_STACK_OF(PROPERTY_DEFINITION)
    49.   
    50.   static const char *skip_space(const char *s)

crypto/stack/stack.c:326:1: parameter `st` of OPENSSL_sk_push
      324.   }
      325.   
      326. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
      327.   {
      328.       if (st == NULL)

crypto/stack/stack.c:330:12: when calling `OPENSSL_sk_insert` here
      328.       if (st == NULL)
      329.           return -1;
      330.       return OPENSSL_sk_insert(st, data, st->num);
                        ^
      331.   }
      332.   

crypto/stack/stack.c:237:1: parameter `st` of OPENSSL_sk_insert
        235.   }
        236.   
        237. > int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc)
        238.   {
        239.       if (st == NULL || st->num == max_nodes)

crypto/stack/stack.c:242:10: when calling `sk_reserve` here
        240.           return 0;
        241.   
        242.       if (!sk_reserve(st, 1, 0))
                        ^
        243.           return 0;
        244.   

crypto/stack/stack.c:160:1: parameter `st` of sk_reserve
          158.   
          159.   /* internal STACK storage allocation */
          160. > static int sk_reserve(OPENSSL_STACK *st, int n, int exact)
          161.   {
          162.       const void **tmpdata;

crypto/stack/stack.c:198:15: when calling `CRYPTO_realloc` here
          196.       }
          197.   
          198.       tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
                               ^
          199.       if (tmpdata == NULL)
          200.           return 0;

crypto/mem.c:238:1: parameter `str` of CRYPTO_realloc
            236.   }
            237.   
            238. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
            239.   {
            240.       INCREMENT(realloc_count);

crypto/mem.c:249:9: when calling `CRYPTO_free` here
            247.   
            248.       if (num == 0) {
            249.           CRYPTO_free(str, file, line);
                           ^
            250.           return NULL;
            251.       }

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
              293.   }
              294.   
              295. > void CRYPTO_free(void *str, const char *file, int line)
              296.   {
              297.       INCREMENT(free_count);

crypto/mem.c:312:5: was invalidated by call to `free()`
              310.       }
              311.   #else
              312.       free(str);
                         ^
              313.   #endif
              314.   }

crypto/property/property_parse.c:377:28: use-after-lifetime part of the trace starts here
375.       int done;
376.   
377.       if (s == NULL || (sk = sk_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
                                  ^
378.           return NULL;
379.   

crypto/property/property_parse.c:377:28: passed as argument to `sk_PROPERTY_DEFINITION_new`
  375.       int done;
  376.   
  377.       if (s == NULL || (sk = sk_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
                                    ^
  378.           return NULL;
  379.   

crypto/property/property_parse.c:377:28: return from call to `sk_PROPERTY_DEFINITION_new`
  375.       int done;
  376.   
  377.       if (s == NULL || (sk = sk_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
                                    ^
  378.           return NULL;
  379.   

crypto/property/property_parse.c:377:23: assigned
  375.       int done;
  376.   
  377.       if (s == NULL || (sk = sk_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
                               ^
  378.           return NULL;
  379.   

crypto/property/property_parse.c:425:5: when calling `sk_PROPERTY_DEFINITION_pop_free` here
  423.   err:
  424.       OPENSSL_free(prop);
  425.       sk_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
             ^
  426.       return res;
  427.   }

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
    293.   }
    294.   
    295. > void CRYPTO_free(void *str, const char *file, int line)
    296.   {
    297.       INCREMENT(free_count);

crypto/mem.c:312:5: invalid access occurs here
    310.       }
    311.   #else
    312.       free(str);
               ^
    313.   #endif
    314.   }
