我在 realloc 之后得到了一个断点。为什么?我怎样才能做对呢?

I get a breakpoint after the realloc. Why? And how can I make it right?

该程序的重​​点是用我的名字替换每一个 2 或更多 人声。 我怎样才能使重新分配成功?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void main() {
    char vocale[] = "AEIOUaeiou", 
            sir[] = "Aana are muaulte meiree.";
    char *src = (char*)malloc(strlen(sir) + 1);
    src = sir;
    char name[] = "Marian";
    int count = 0, 
            i = 0;
    while (i < strlen(src)) {
        if (strchr(vocale, src[i])) {
            count++;
            i++;
        }
        else {
            if (count >= 2) {
                src = (char*)realloc(src, strlen(src) + strlen(name) + 1);
                insereaza(src, count, name, i);
                i = i + strlen(name);
                count = 0;
            }
            else {
                count = 0;
                i++;
            }
        }
    }
    puts(src);
    _getch();
}

这里有一些修改的提案,很难,因为我不知道insereaza是做什么的

void main() {
  const char * vocale = "AEIOUaeiou";
  char * src = strdup("Aana are muaulte meiree."); /* must be in the heap for realloc */
  const char * name = "Marian";
  int srcLen  = strlen(src);
  int nameLen = strlen(name);
  int count = 0, i = 0;

  while (i < srcLen) {
    if (strchr(vocale, src[i])) {
      count++;
      i++;
    }
    else {
      if (count >= 2) {
        src = (char*) realloc(src, srcLen + nameLen + 1); /* perhaps too large */
        insereaza(src, count, name, i);
        srcLen += nameLen; /* or srcLen += nameLen - count + 1 ? */
        i += nameLen; /* or i += nameLen - count + 1 ? */
      }
      else {
        i++;
      }
      count = 0;
    }
  }
  puts(src);
  _getch();
}