~ubuntu-branches/ubuntu/oneiric/gnupg2/oneiric-updates

« back to all changes in this revision

Viewing changes to g10/kbnode.c

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* kbnode.c -  keyblock node utility functions
2
 
 * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
2
 * Copyright (C) 1998, 1999, 2000, 2001, 2002,
 
3
 *               2005 Free Software Foundation, Inc.
3
4
 *
4
5
 * This file is part of GnuPG.
5
6
 *
6
7
 * GnuPG is free software; you can redistribute it and/or modify
7
8
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * the Free Software Foundation; either version 3 of the License, or
9
10
 * (at your option) any later version.
10
11
 *
11
12
 * GnuPG is distributed in the hope that it will be useful,
14
15
 * GNU General Public License for more details.
15
16
 *
16
17
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
18
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19
19
 */
20
20
 
21
21
#include <config.h>
26
26
 
27
27
#include "gpg.h"
28
28
#include "util.h"
29
 
#include "memory.h"
30
29
#include "packet.h"
31
30
#include "keydb.h"
32
31
 
43
42
    if( n )
44
43
        unused_nodes = n->next;
45
44
    else
46
 
        n = xmalloc ( sizeof *n );
 
45
        n = xmalloc( sizeof *n );
47
46
    n->next = NULL;
48
47
    n->pkt = NULL;
49
48
    n->flag = 0;
60
59
        n->next = unused_nodes;
61
60
        unused_nodes = n;
62
61
#else
63
 
        xfree ( n );
 
62
        xfree( n );
64
63
#endif
65
64
    }
66
65
}
96
95
        n2 = n->next;
97
96
        if( !is_cloned_kbnode(n) ) {
98
97
            free_packet( n->pkt );
99
 
            xfree ( n->pkt );
 
98
            xfree( n->pkt );
100
99
        }
101
100
        free_node( n );
102
101
        n = n2;
114
113
    node->private_flag |= 1;
115
114
}
116
115
 
117
 
 
118
 
 
119
116
/****************
120
117
 * Append NODE to ROOT.  ROOT must exist!
121
118
 */
269
266
                nl->next = n->next;
270
267
            if( !is_cloned_kbnode(n) ) {
271
268
                free_packet( n->pkt );
272
 
                xfree ( n->pkt );
 
269
                xfree( n->pkt );
273
270
            }
274
271
            free_node( n );
275
272
            changed = 1;
293
290
                nl->next = n->next;
294
291
            if( !is_cloned_kbnode(n) ) {
295
292
                free_packet( n->pkt );
296
 
                xfree ( n->pkt );
 
293
                xfree( n->pkt );
297
294
            }
298
295
            free_node( n );
299
296
        }