79402554

Date: 2025-01-31 11:14:02
Score: 0.5
Natty:
Report link
void getData(char** dst) {
    *dst = malloc(sizeof(char) * 50);
    if (*dst == NULL) {
        fprintf(stderr, "Memory allocation failed\n");
        return;
    }
    sprintf(*dst, "This is a test.\r\n");
}

Directly allocates memory to *dst and check you can allocate memory.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: R.F.