Why Nostr? What is Njump?
2024-01-28 19:01:16
in reply to

Louis on Nostr: npub18g4k0…2n4gd Case 1: realloc could extend the memory block buf points to, it ...

Case 1: realloc could extend the memory block buf points to, it will return a pointer to buf

Case 2: realloc could not extend buf, but found a new memory block big enough, it copies the contents of buf to a new block, frees buf and returns pointer to the new block

Case 3: realloc could not find any memory, it will just return NULL

So in your case, you should just check for outp == NULL and then continue to work with outp, because it will be either Case 1 (the same memory block) or Case 2 ( a new memory block with the contents of the old memory block ).
Author Public Key
npub1tp9e9qhmc02khh3jzpn8vmqwhj3u25yw352ed2x87zs4e2ps2uwqhadzfn