# HG changeset patch # User Michael Pavone # Date 1530290003 25200 # Node ID 137dbd05ceab9e91bbca753e0d17c423d87accc5 # Parent 24508cb54f87e7799e261ab36ba033bbd80e82ad Fix some issues identified by cppcheck diff -r 24508cb54f87 -r 137dbd05ceab dis.c --- a/dis.c Thu Jun 28 09:27:05 2018 -0700 +++ b/dis.c Fri Jun 29 09:33:23 2018 -0700 @@ -206,6 +206,7 @@ } } } + fclose(address_log); } } else { char *end; diff -r 24508cb54f87 -r 137dbd05ceab jagcpu_x86.c --- a/jagcpu_x86.c Thu Jun 28 09:27:05 2018 -0700 +++ b/jagcpu_x86.c Fri Jun 29 09:33:23 2018 -0700 @@ -102,7 +102,7 @@ code_ptr no_delay = code-.cur + 1; jcc(code, CC_NZ, no_delay + 1); ccylces(code, 1); - *no_delay = code->cur - (no_delay = 1); + *no_delay = code->cur - (no_delay + 1); *no_result = code->cur - (no_result + 1); mov_rr(code, opts->resultreg, opts->writeback, SZ_B); } @@ -122,7 +122,7 @@ uint16_t *translate_jag_inst(uint16_t *stream, jag_cpu_options *opts, uint32_t address) { - uint16_t inst = *stream + uint16_t inst = *stream; ++stream; uint16_t opcode = jag_opcode(inst, opts->is_gpu); check_cycles_int(&opts->gen, address); diff -r 24508cb54f87 -r 137dbd05ceab nuklear_ui/font_win.c --- a/nuklear_ui/font_win.c Thu Jun 28 09:27:05 2018 -0700 +++ b/nuklear_ui/font_win.c Fri Jun 29 09:33:23 2018 -0700 @@ -136,6 +136,7 @@ free(path); } } + free(pref_prefix); free(fonts); free_dir_list(entries, num_entries); if (selected) { diff -r 24508cb54f87 -r 137dbd05ceab util.c --- a/util.c Thu Jun 28 09:27:05 2018 -0700 +++ b/util.c Fri Jun 29 09:33:23 2018 -0700 @@ -255,8 +255,8 @@ if (initial < 0x80) { return initial; } - int base; - uint8_t extended_bytes; + int base = 0; + uint8_t extended_bytes = 0; if ((initial & 0xE0) == 0xC0) { base = 0x80; initial &= 0x1F; @@ -873,6 +873,7 @@ } else { ret = NULL; } + fclose(f); return ret; } diff -r 24508cb54f87 -r 137dbd05ceab zdis.c --- a/zdis.c Thu Jun 28 09:27:05 2018 -0700 +++ b/zdis.c Fri Jun 29 09:33:23 2018 -0700 @@ -112,6 +112,7 @@ } } } + fclose(address_log); break; case 's': opt++; diff -r 24508cb54f87 -r 137dbd05ceab zip.c --- a/zip.c Thu Jun 28 09:27:05 2018 -0700 +++ b/zip.c Fri Jun 29 09:33:23 2018 -0700 @@ -176,8 +176,8 @@ } } break; + } #endif - } default: free(buf); return NULL;