scd: Improve error handling.
authorJustus Winter <justus@g10code.com>
Tue, 17 Nov 2015 17:05:51 +0000 (18:05 +0100)
committerJustus Winter <justus@g10code.com>
Thu, 19 Nov 2015 14:46:29 +0000 (15:46 +0100)
* scd/app-openpgp.c (get_public_key): Improve error handling.
--
Found using the Clang Static Analyzer.

Signed-off-by: Justus Winter <justus@g10code.com>
scd/app-openpgp.c

index a7601b8..0fcfffe 100644 (file)
@@ -1468,7 +1468,7 @@ get_public_key (app_t app, int keyno)
   xfree (buffer);
   xfree (mbuf);
   xfree (ebuf);
-  return 0;
+  return err;
 }
 #endif /* GNUPG_MAJOR_VERSION > 1 */