diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-04-03 14:11:06 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-04-03 14:11:06 -0700 |
commit | 6a3f6fd8544907c0e28a3b97b906b06ca51e0581 (patch) | |
tree | f7610d1cff5096180cf406acb94ec643deee11a7 | |
parent | b43e14be1b0a292fbe71424161c8a9244eea9dab (diff) |
NewClip: use calloc instead of manually setting values to 0 after malloc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xclipboard.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/xclipboard.c b/xclipboard.c index 9c92556..bac092f 100644 --- a/xclipboard.c +++ b/xclipboard.c @@ -134,14 +134,10 @@ NewClip(Widget w, ClipPtr old) { ClipPtr newClip; - newClip = (ClipPtr) malloc (sizeof (ClipRec)); + newClip = calloc (1, sizeof (ClipRec)); if (!newClip) return newClip; - newClip->clip = NULL; - newClip->avail = 0; newClip->prev = old; - newClip->next = NULL; - newClip->filename = NULL; if (old) { newClip->next = old->next; |