Very shortly after LavX64 (a user who's pretty new to this site - 16 rep) asked this question, the user πάντα ῥεῖ single handedly marked the question as a duplicate.

Two problems now:

The marked duplicate has more or less nothing to do with the problem the OP actually has (see below for an in-depth discussion of this).

At the time of dupmarking, the question had tag c++, but now that tag was removed - so possibly, πάντα ῥεῖ can't even revoke this mark because the question no longer has the needed tag (idk this for sure, of course).

I did raise a flag about this issue shortly after the question got dupmarked, but nothing (I can see) happened since. I just clicked the flag link again, possibly I could raise it again, but I don't feel, flag spamming is the appropriate way to handle issues like this.

So, how is the marked duplicate not a duplicate? Duplicate marking should be done on an "exact duplicate of an existing question". Possibly, I and the Stack Overflow community have very different ideas about what that means. For me, it means, that every single aspect of the question is not only asked in the other question, but more importantly also answered.

Now, let me dig down into the posted question a little bit more: The question was, after

int *arr = (int*) malloc(3);

how to realloc. Possibly he actually tried realloc at some point, but his code obviously has some problems even without the reallocation problem itself:

Casting of the return value of malloc

Allocating 3 bytes instead of space for 3 ints.

Especially the last one is a very good candidate to be the real problem of the OP here, because no realloc will care for the memory after the first 3 bytes.

The question isn't really the same, OP coming from .NET and is thus assuming other behavior.

The OP didn't have any code yet - especially no wrong code.

Even so: The accepted answer doesn't explicitly hint on the missing sizeof

The accepted answer doesn't mention to omit the retval typecast.
(5. Additionally, as can be read in the comments on Shog9 response to my question as well as in the comments on the accepted answer in the linked dup: The accepted answer provides a very poor example on how to use malloc and realloc.)

So again, the question hardly qualifies as exact duplicate.

It may be similar, but whether it helps the OP is a completely different story. Especially, his response to my hint to use new_ptr = realloc suggest, more than a dupmarking is necessary.

Oh, and finally: It's not my job to explain why something is NOT a duplicate of something else, anyone who marks something as exact duplicate should feel responsible to be able to explain, why it IS an exact duplicate. And I can hardly believe, that anyone can check an issue like this in 5 seconds (time of the first two downvotes, after posting revision 1 of this questions - relevant comments got deleted by s/b). This site is not a competition on who can dupvote the fastest. (Or at least, it should not be about that.)

And the answer to the current dupmarking of this meta question even contains a hint »Don't assume malice or laziness.« but the whole process (including the handling of this meta question) leaves me to believe, laziness is the exact correct term to use to describe, what's going on here.

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

"It's not my job to explain why something is NOT a duplicate of something else" Certainly doesn't feel that way.
– WillNov 29 '16 at 18:13

"For me, it means, that every single aspect of the question is not only asked in the other question" - nope. "Every single aspect" would cause any potential duplicate to be invalidated, because the variable names are different or whatever.
– CodeCasterNov 29 '16 at 22:12

1 Answer
1

Explaining why the question wasn't a duplicate would've been a good start. You can either post a comment, or edit the question, or both - the critical bit is that you calmly explain why the linked question is incorrect.

That question's been viewed nearly 24 thousand times, @Bodo - this is why it's so critical that we find and mark duplicates: if the advice there is bad, it doesn't matter if we give good advice to one new person; most people don't ask, they search. So thousands of others will continue reading bad advice.
– Shog9♦Nov 29 '16 at 21:40

So, then link to GOOD answers instead, then those get best impact on search engines. Your argument isn't really one.
– Bodo ThiesenNov 29 '16 at 22:30

And dupmarking to a question, that has nothing to do with the original question is no dependency for fixing the other answer either.
– Bodo ThiesenNov 29 '16 at 22:31