eet_cipher: Fix initialization of opened variable
authorDaniel Willmann <d.willmann@samsung.com>
Tue, 19 Mar 2013 16:28:37 +0000 (16:28 +0000)
committerDaniel Willmann <d.willmann@samsung.com>
Tue, 19 Mar 2013 17:00:33 +0000 (17:00 +0000)
commit1d8f06511c60727392d2948d074968c5917159ad
tree9d4da7ce1f90a86df6471751c2714f722fe625b5
parenta32870c424e65e80b0d49419efb9fe0d9949c641
eet_cipher: Fix initialization of opened variable

In the error case we 'goto' the error path directly without passing
through the declaration and initialization of the variable.

This doesn't work so move the declaration/initialization to the start.
See this example (compile with -Wall for the warning):

-----
 #include <stdio.h>

 int main(void)
 {
   goto bar;

   int i = 15;

 bar:
   printf("Foo: %i\n", i);

   return 0;
 }
----

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
src/lib/eet/eet_cipher.c