Commit c10e8603 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Fixed compilation with GCC11

parent fe2a1fbe
all:
tar xf libselinux-3.0.tar.gz
patch -Np1 -d libselinux-3.0 < libselinux-3.0-gcc11_fix.patch
$(MAKE) -C libselinux-3.0
$(MAKE) -C libselinux-3.0 install
rm -rf libselinux-3.0
\ No newline at end of file
diff -uNr libselinux-3.0/src/label_file.h libselinux-3.0-free_fix/src/label_file.h
--- libselinux-3.0/src/label_file.h 2019-11-28 23:16:48.000000000 +1030
+++ libselinux-3.0-free_fix/src/label_file.h 2024-07-28 21:53:28.368696603 +0930
@@ -286,7 +286,6 @@
tmp_arr = realloc(data->stem_arr,
sizeof(*tmp_arr) * alloc_stems);
if (!tmp_arr) {
- free(buf);
return -1;
}
data->alloc_stems = alloc_stems;
@@ -308,6 +307,7 @@
int stem_len = get_stem_from_spec(buf);
int stemid;
char *stem;
+ int r;
if (!stem_len)
return -1;
@@ -321,7 +321,11 @@
if (!stem)
return -1;
- return store_stem(data, stem, stem_len);
+ r = store_stem(data, stem, stem_len);
+ if (r < 0)
+ free(stem);
+
+ return r;
}
/* This will always check for buffer over-runs and either read the next entry
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment