X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=lib%2Fhashtable.c;h=02b41050a44f6656e9605e288f5f6a97faf3539c;hb=f7cf291aa788eb5b64c0d16de529b1a378f509bb;hp=7df424ad87a6e901cbfb02d224316b3f665341fb;hpb=817e48d8a2998b19dc36a77f8363b5f74bc3fa9e;p=u-boot diff --git a/lib/hashtable.c b/lib/hashtable.c index 7df424ad87..02b41050a4 100644 --- a/lib/hashtable.c +++ b/lib/hashtable.c @@ -842,8 +842,10 @@ int himport_r(struct hsearch_data *htab, } } - if(!size) + if (!size) { + free(data); return 1; /* everything OK */ + } if(crlf_is_lf) { /* Remove Carriage Returns in front of Line Feeds */ unsigned ignored_crs = 0; @@ -907,6 +909,7 @@ int himport_r(struct hsearch_data *htab, if (*name == 0) { debug("INSERT: unable to use an empty key\n"); __set_errno(EINVAL); + free(data); return 0; }