diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-03-14 21:05:25 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-03-15 08:19:33 +0000 |
commit | bac9b5b6fdfb9d3f306bb65f6509dce7144e82ad (patch) | |
tree | 5888012938e3ca1ab23e100f477d1f60be60cf55 /epan/wslua/lrexlib.c | |
parent | f75f1d54c4bad6bd130af924b5dba71fb5774652 (diff) |
Fix lrexlib.c clang static analyzer warning
This fixes a "Argument with 'nonnull' attribute passed null" warning
generated by the clang static analyzer. It's a false positive, but
easy to remedy.
Change-Id: Id737d1ac29765ed26a416c5cd13bedafee478fb6
Reviewed-on: https://code.wireshark.org/review/661
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/wslua/lrexlib.c')
-rw-r--r-- | epan/wslua/lrexlib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/epan/wslua/lrexlib.c b/epan/wslua/lrexlib.c index 572aa60664..5d99522678 100644 --- a/epan/wslua/lrexlib.c +++ b/epan/wslua/lrexlib.c @@ -158,6 +158,7 @@ void buffer_init (TBuffer *buf, size_t sz, lua_State *L, TFreeList *fl) { if (!buf->arr) { freelist_free (fl); luaL_error (L, "malloc failed"); + return; } buf->size = sz; buf->top = 0; @@ -189,6 +190,7 @@ void buffer_addlstring (TBuffer *buf, const void *src, size_t sz) { if (!p) { freelist_free (buf->freelist); luaL_error (buf->L, "realloc failed"); + return; } buf->arr = p; buf->size = 2 * newtop; @@ -247,6 +249,7 @@ void bufferZ_putrepstring (TBuffer *BufRep, int reppos, int nsub) { else if (num > nsub) { freelist_free (BufRep->freelist); luaL_error (BufRep->L, "invalid capture index"); + return; } bufferZ_addnum (BufRep, num); } |