Fix realloc invalid next size
[lttng-tools.git] / lttng-sessiond / ust-app.c
index 0472251434dbb8fb1953ceda2777ce7a46412adb..1afb6d199db7bbda66e52979742e93d2a33a4cb9 100644 (file)
@@ -1185,7 +1185,7 @@ int ust_app_list_events(struct lttng_event **events)
                                DBG2("Reallocating event list from %zu to %zu bytes", nbmem,
                                                nbmem + UST_APP_EVENT_LIST_SIZE);
                                nbmem += UST_APP_EVENT_LIST_SIZE;
-                               tmp = realloc(tmp, nbmem);
+                               tmp = realloc(tmp, nbmem * sizeof(struct lttng_event));
                                if (tmp == NULL) {
                                        PERROR("realloc ust app events");
                                        ret = -ENOMEM;
This page took 0.025137 seconds and 5 git commands to generate.