Message ID | 1331210892-27643-1-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 03/08/2012 08:48 PM, Colin King wrote: > From: Colin Ian King<colin.king@canonical.com> > > Signed-off-by: Colin Ian King<colin.king@canonical.com> > --- > src/lib/src/fwts_klog.c | 4 +--- > 1 files changed, 1 insertions(+), 3 deletions(-) > > diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c > index 39e8183..7b7fb41 100644 > --- a/src/lib/src/fwts_klog.c > +++ b/src/lib/src/fwts_klog.c > @@ -66,10 +66,8 @@ fwts_list *fwts_klog_read(void) > if ((len = klogctl(10, NULL, 0))< 0) > return NULL; > > - if ((buffer = calloc(1, len)) == NULL) { > - free(buffer); > + if ((buffer = calloc(1, len)) == NULL) > return NULL; > - } > > if (klogctl(3, buffer, len)< 0) { > free(buffer); Acked-by: Alex Hung <alex.hung@canonical.com>
On Thu, Mar 8, 2012 at 8:48 PM, Colin King <colin.king@canonical.com> wrote: > From: Colin Ian King <colin.king@canonical.com> > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_klog.c | 4 +--- > 1 files changed, 1 insertions(+), 3 deletions(-) > > diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c > index 39e8183..7b7fb41 100644 > --- a/src/lib/src/fwts_klog.c > +++ b/src/lib/src/fwts_klog.c > @@ -66,10 +66,8 @@ fwts_list *fwts_klog_read(void) > if ((len = klogctl(10, NULL, 0)) < 0) > return NULL; > > - if ((buffer = calloc(1, len)) == NULL) { > - free(buffer); > + if ((buffer = calloc(1, len)) == NULL) > return NULL; > - } > > if (klogctl(3, buffer, len) < 0) { > free(buffer); > -- > 1.7.9 > Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c index 39e8183..7b7fb41 100644 --- a/src/lib/src/fwts_klog.c +++ b/src/lib/src/fwts_klog.c @@ -66,10 +66,8 @@ fwts_list *fwts_klog_read(void) if ((len = klogctl(10, NULL, 0)) < 0) return NULL; - if ((buffer = calloc(1, len)) == NULL) { - free(buffer); + if ((buffer = calloc(1, len)) == NULL) return NULL; - } if (klogctl(3, buffer, len) < 0) { free(buffer);