diff --git a/src/runtime/c/pgf/db.cxx b/src/runtime/c/pgf/db.cxx index d0f120c8f..8caaa6673 100644 --- a/src/runtime/c/pgf/db.cxx +++ b/src/runtime/c/pgf/db.cxx @@ -260,7 +260,7 @@ PgfDB::PgfDB(const char* filepath, int flags, int mode) { base = ((unsigned char *) ms) + page_size; } - hМutex = CreateMutex(NULL, FALSE, mutex_name); + hMutex = CreateMutex(NULL, FALSE, mutex_name); if (hМutex == NULL) { if (fd < 0) { ::free(ms); @@ -1416,9 +1416,10 @@ void PgfDB::resize_map(size_t new_size) if (ms == NULL) throw pgf_systemerror(last_error_to_errno()); } else { - new_ms = (malloc_state*) ::realloc(ms, new_size); + malloc_state *new_ms = (malloc_state*) ::realloc(ms, new_size); if (new_ms == NULL) throw pgf_systemerror(ENOMEM); + ms = new_ms; } new_size -= page_size;