Skip to content

Commit 6e64126

Browse files
author
Markus Raab
committed
reformat all
1 parent 8539e2e commit 6e64126

File tree

4 files changed

+599
-627
lines changed

4 files changed

+599
-627
lines changed

benchmarks/memoryleak.c

+7-8
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
int main (void)
1818
{
19-
KDB * handles[NUM_RUNS];
20-
KeySet * keysets[NUM_RUNS];
19+
KDB * handles[NUM_RUNS];
20+
KeySet * keysets[NUM_RUNS];
2121

22-
Key * parentKey = keyNew ("user", KEY_END);
22+
Key * parentKey = keyNew ("user", KEY_END);
2323

2424
for (size_t i = 0; i < NUM_RUNS; ++i)
2525
{
@@ -29,20 +29,19 @@ int main (void)
2929

3030
kdbGet (handle, ks, parentKey);
3131

32-
printf("Retrieved %d keys\n", (int)ksGetSize(ks));
32+
printf ("Retrieved %d keys\n", (int) ksGetSize (ks));
3333

3434
handles[i] = handle;
3535
keysets[i] = ks;
3636
}
3737

3838
for (size_t i = 0; i < NUM_RUNS; ++i)
3939
{
40-
printf("Freeing %d keys\n", (int)ksGetSize(keysets[i]));
40+
printf ("Freeing %d keys\n", (int) ksGetSize (keysets[i]));
4141

42-
kdbClose(handles[i], parentKey);
43-
ksDel(keysets[i]);
42+
kdbClose (handles[i], parentKey);
43+
ksDel (keysets[i]);
4444
}
4545

4646
keyDel (parentKey);
4747
}
48-

doc/news/_preparation_next_release.md

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ The text below summarizes updates to the [C (and C++)-based libraries](https://w
153153
- `kdbconfig.h` is no longer included in the installed headers. This is because it could cause conflicts with other
154154
`config.h`-type headers from applications. _(Klemens Böswirth)_
155155
- `ksAppendKey`: state that it only fail on memory problems. _(Markus Raab)_
156+
- Fix memory leak in `kdbGet`. _(Markus Raab)_
156157
- Implemented `kdberrors.h` directly without generation of the `specification` file because of drastically reduced error code count _(Michael Zronek)_
157158
- `keyIsDirectBelow` was renamed to `keyIsDirectlyBelow`. _(Philipp Gackstatter)_
158159
- `keyMeta` was added to provide access to a key's underlying KeySet that holds its metadata keys. _(Philipp Gackstatter)_

src/libs/elektra/keyset.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2567,13 +2567,13 @@ int ksClose (KeySet * ks)
25672567
keyDel (k);
25682568
}
25692569

2570-
printf("ksClose did NOT free %d keys\n", keysNotFreed);
2570+
printf ("ksClose did NOT free %d keys\n", keysNotFreed);
25712571

25722572
if (ks->array && !test_bit (ks->flags, KS_FLAG_MMAP_ARRAY))
25732573
{
25742574
elektraFree (ks->array);
25752575
}
2576-
2576+
25772577
clear_bit (ks->flags, (keyflag_t) KS_FLAG_MMAP_ARRAY);
25782578

25792579
ks->array = 0;

0 commit comments

Comments
 (0)