mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Free various struct membuffer in different functions
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
d6c8edc2db
commit
b5ce06c8b9
4 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue