perf tools: Introduce zalloc() for the common calloc(1, N) case
[deliverable/linux.git] / tools / perf / builtin-probe.c
index d78a3d945492c0b8070479d91bea45a5dc8ec8cb..a2f6daf01ecb08d44d6148def1aa476a735560a4 100644 (file)
@@ -309,9 +309,9 @@ static int synthesize_probe_event(struct probe_point *pp)
 {
        char *buf;
        int i, len, ret;
-       pp->probes[0] = buf = (char *)calloc(MAX_CMDLEN, sizeof(char));
+       pp->probes[0] = buf = zalloc(MAX_CMDLEN);
        if (!buf)
-               die("Failed to allocate memory by calloc.");
+               die("Failed to allocate memory by zalloc.");
        ret = snprintf(buf, MAX_CMDLEN, "%s+%d", pp->function, pp->offset);
        if (ret <= 0 || ret >= MAX_CMDLEN)
                goto error;
This page took 0.025061 seconds and 5 git commands to generate.