Re: [gmime-devel] [PATCH 5/6] Use pinentry-mode loopback in test suite when using "modern" GnuPG



Hi guys,

On 12/02/2016 10:11:18 AM Fri, Jeffrey Stedfast wrote:
Commentary inline...
...
  +static int
+is_gpg_modern()
+{
+       const char vheader[] = "gpg (GnuPG) ";
+       FILE *vpipe;
+       char *vstring;
+       size_t vlen;
+       int ret;
+
+       if ((vpipe = popen ("gpg --version", "r")) == NULL)
+               return 0;
+       vlen = 0;
+       vstring = NULL;
+       if (getline (&vstring, &vlen, vpipe) == -1)
+               return 0;

Shouldn't vpipe be closed in this error condition?

Also vstring should be freed in *both* error conditions.

Peter

Attachment: pgp52lVUq0PFP.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]