On April 25, 2014 2:14:29 AM CEST, Peter Malone <[email protected]> wrote:
>Hi,
>
>Here's another.
>
>Index: l2tp_ctrl.c
>===================================================================
>RCS file: /cvs/src/usr.sbin/npppd/l2tp/l2tp_ctrl.c,v
>retrieving revision 1.16
>diff -u -p -u -r1.16 l2tp_ctrl.c
>--- l2tp_ctrl.c        13 Sep 2013 03:25:27 -0000      1.16
>+++ l2tp_ctrl.c        25 Apr 2014 00:13:13 -0000
>@@ -108,10 +108,9 @@ l2tp_ctrl_create(void)
> {
>       l2tp_ctrl *_this;
> 
>-      if ((_this = malloc(sizeof(l2tp_ctrl))) == NULL)
>+      if ((_this = calloc(1, sizeof(l2tp_ctrl))) == NULL)
>               return NULL;
> 
>-      memset(_this, 0, sizeof(l2tp_ctrl));
>       return (l2tp_ctrl *)_this;

Can't this be reduced to a single

  return calloc(1, sizeof(l2tp_ctrl));

? :-)

/Alexander

> }
> 

Reply via email to