diff options
author | Walter Harms <wharms@bfs.de> | 2019-08-19 17:52:16 +0200 |
---|---|---|
committer | Walter Harms <wharms@bfs.de> | 2019-08-19 17:52:16 +0200 |
commit | 956c0e145a87d2b19144d820c33c3d64ac348043 (patch) | |
tree | 28e09a0530338c947f1578f30102fcf1e94b878f | |
parent | 91860c7f6ab6e18bb2e0f0bfaa38e09274c6cc2e (diff) |
FIX: malloc+memset=calloc
libc has a function to provide clean memory, so use it
Signed-off-by: Walter Harms <wharms@bfs.de>
-rw-r--r-- | xrestop.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -260,8 +260,7 @@ xrestop_client_new(XResTopApp *app) { XResTopClient *client = NULL; - client = malloc(sizeof(XResTopClient)); - memset(client, 0, sizeof(XResTopClient)); + client = calloc(1,sizeof(XResTopClient)); client->pid = -1; @@ -643,8 +642,7 @@ main(int argc, char **argv) int i, event, error, major, minor; XResTopApp *app = NULL; - app = malloc(sizeof(XResTopApp)); - memset(app, 0, sizeof(XResTopApp)); + app = calloc(1,sizeof(XResTopApp)); app->delay = 2; |