aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2016-07-28 08:56:22 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2016-08-10 16:59:32 +0200
commit48b3bb980d4a026d32739acc1982f16e3c303c5b (patch)
tree1685d44bb69642771a9840171bcab93a68f6da49 /src/util
parent1be3894e6f283b0538a725bc438922c7d7ec294a (diff)
downloadminetest-48b3bb980d4a026d32739acc1982f16e3c303c5b.tar.gz
minetest-48b3bb980d4a026d32739acc1982f16e3c303c5b.tar.bz2
minetest-48b3bb980d4a026d32739acc1982f16e3c303c5b.zip
couple of memory leaks fixes.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/areastore.cpp1
-rw-r--r--src/util/srp.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/util/areastore.cpp b/src/util/areastore.cpp
index 58f08a8c2..cef67da2c 100644
--- a/src/util/areastore.cpp
+++ b/src/util/areastore.cpp
@@ -95,6 +95,7 @@ void AreaStore::deserialize(std::istream &is)
is.read(data, data_len);
a.data = std::string(data, data_len);
insertArea(&a);
+ delete [] data;
}
}
diff --git a/src/util/srp.cpp b/src/util/srp.cpp
index 0d3c938a3..77c1816e8 100644
--- a/src/util/srp.cpp
+++ b/src/util/srp.cpp
@@ -542,7 +542,7 @@ static SRP_Result fill_buff()
if (!fp) return SRP_ERR;
- if (fread(g_rand_buff, sizeof(g_rand_buff), 1, fp) != 1) return SRP_ERR;
+ if (fread(g_rand_buff, sizeof(g_rand_buff), 1, fp) != 1) { fclose(fp); return SRP_ERR; }
if (fclose(fp)) return SRP_ERR;
#endif
return SRP_OK;