libsemanage: Fix use of unitialized variable

"gcc -O2 -Wall -Werror" fails to compile seusers_local.c:

  seusers_local.c: In function 'semanage_seuser_modify_local':
  seusers_local.c:122:6: error: 'rc' may be used uninitialized in this
  function [-Werror=maybe-uninitialized]

It seems rc is not initialized when the call to semanage_seuser_clone
fails in semanage_seuser_modify_local.

Acked-by: Steve Lawrence <slawrence@tresys.com>
This commit is contained in:
Nicolas Iooss 2014-09-14 23:41:33 +02:00 committed by Steve Lawrence
parent 278ae562d6
commit 9a6091479d
1 changed files with 2 additions and 1 deletions

View File

@ -131,7 +131,8 @@ int semanage_seuser_modify_local(semanage_handle_t * handle,
errno=EINVAL;
return -1;
}
if (semanage_seuser_clone(handle, data, &new) < 0) {
rc = semanage_seuser_clone(handle, data, &new);
if (rc < 0) {
goto err;
}