selinux: fix const qualifier warning

rc-selinux.c: In function ‘selinux_setup’:
rc-selinux.c:361:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  curr_t = context_type_get(curr_con);
         ^
This commit is contained in:
Jason Zaman 2017-09-17 23:52:52 +08:00 committed by William Hubbs
parent b1c3422f45
commit db4a578273

View File

@ -358,14 +358,13 @@ void selinux_setup(char **argv)
goto out; goto out;
} }
curr_t = context_type_get(curr_con); curr_t = xstrdup(context_type_get(curr_con));
if (!curr_t) { if (!curr_t) {
context_free(curr_con); context_free(curr_con);
free(curr_context); free(curr_context);
goto out; goto out;
} }
curr_t = xstrdup(curr_t);
/* dont need them anymore so free() now */ /* dont need them anymore so free() now */
context_free(curr_con); context_free(curr_con);
free(curr_context); free(curr_context);