aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/linux.c1
-rw-r--r--core/save-git.c2
-rw-r--r--desktop-widgets/subsurfacewebservices.cpp2
-rw-r--r--profile-widget/diveeventitem.cpp1
4 files changed, 5 insertions, 1 deletions
diff --git a/core/linux.c b/core/linux.c
index 2ae4d5c7e..de7991bc7 100644
--- a/core/linux.c
+++ b/core/linux.c
@@ -42,6 +42,7 @@ void subsurface_user_info(struct user_info *user)
gethostname(hostname, sizeof(hostname));
put_format(&mb, "%s@%s", username, hostname);
user->email = mb_cstring(&mb);
+ free_buffer(&mb);
}
}
diff --git a/core/save-git.c b/core/save-git.c
index d09513e1d..a00aeed94 100644
--- a/core/save-git.c
+++ b/core/save-git.c
@@ -903,6 +903,7 @@ static void save_divesites(git_repository *repo, struct dir *tree)
struct membuffer dirname = { 0 };
put_format(&dirname, "01-Divesites");
subdir = new_directory(repo, tree, &dirname);
+ free_buffer(&dirname);
for (int i = 0; i < dive_site_table.nr; i++) {
struct membuffer b = { 0 };
@@ -946,6 +947,7 @@ static void save_divesites(git_repository *repo, struct dir *tree)
}
}
blob_insert(repo, subdir, &b, mb_cstring(&site_file_name));
+ free_buffer(&site_file_name);
}
}
diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp
index 93398ae6c..2db35b88a 100644
--- a/desktop-widgets/subsurfacewebservices.cpp
+++ b/desktop-widgets/subsurfacewebservices.cpp
@@ -125,7 +125,7 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
report_error(tr("internal error").toUtf8());
goto error_close_zip;
}
- free((void *)membuf);
+ free_buffer(&mb);
transformed = xsltApplyStylesheet(xslt, doc, NULL);
if (!transformed) {
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp
index f47c5839c..8c8db6fd4 100644
--- a/profile-widget/diveeventitem.cpp
+++ b/profile-widget/diveeventitem.cpp
@@ -184,6 +184,7 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix)
tr("ΔN₂").toUtf8().constData(), icd_data.dN2 / 10.0,
icd ? ">" : "<", lrint(-icd_data.dHe / 5.0) / 10.0);
name += QString::fromUtf8(mb.buffer, mb.len);
+ free_buffer(&mb);
}
*lastgasmix = *mix;
} else if (value) {