Louis on Nostr: npub18g4k0…2n4gd Case 1: realloc could extend the memory block buf points to, it ...
npub18g4k0gljynatgs2anultm3y55tmd2qjxra8wgywe8nqr3cr26g4qe2n4gd (npub18g4…n4gd) 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 ).
Published at
2024-01-28 19:01:16Event JSON
{
"id": "553f158ab10b619e82550074462809b2473d6a54384ef8da7e3c25091f6ebaf2",
"pubkey": "584b9282fbc3d56bde321066766c0ebca3c5508e8d1596a8c7f0a15ca830571c",
"created_at": 1706468476,
"kind": 1,
"tags": [
[
"p",
"3a2b67a3f224fab4415d9f3ebdc494a2f6d502461f4ee411d93cc038e06ad22a",
"wss://relay.mostr.pub"
],
[
"p",
"9e5231bb994c213b4b5bc1d12b01260bc4a8238b77b38f81d1bd270d037e47a5",
"wss://relay.mostr.pub"
],
[
"e",
"585ec82c402790e379f151c6594808c653336559e0fb6341b94a4060b80bc6dc",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://emacs.ch/users/louis/statuses/111835118074732432",
"activitypub"
]
],
"content": "nostr:npub18g4k0gljynatgs2anultm3y55tmd2qjxra8wgywe8nqr3cr26g4qe2n4gd Case 1: realloc could extend the memory block buf points to, it will return a pointer to buf\n\nCase 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\n\nCase 3: realloc could not find any memory, it will just return NULL\n\nSo 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 ).",
"sig": "0f747351cd51250ae02cd63468dabb6434e902fb025d475ab83581676b2d66fab29e3e61996565dbbf200e0b82647442dcb411a83975bc59b62285d1a9218279"
}