~ubuntu-branches/ubuntu/utopic/dnsmasq/utopic

« back to all changes in this revision

Viewing changes to src/dbus.c

  • Committer: Package Import Robot
  • Author(s): Simon Kelley
  • Date: 2013-08-04 14:48:21 UTC
  • mfrom: (0.5.5) (12.2.13 sid)
  • Revision ID: package-import@ubuntu.com-20130804144821-53zdaugru2z9mgsp
Tags: 2.66-4
Update resolvconf script. (closes: #716908)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* dnsmasq is Copyright (c) 2000-2012 Simon Kelley
 
1
/* dnsmasq is Copyright (c) 2000-2013 Simon Kelley
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
91
91
 
92
92
static void remove_watch(DBusWatch *watch, void *data)
93
93
{
94
 
  struct watch **up, *w;  
 
94
  struct watch **up, *w, *tmp;  
95
95
  
96
 
  for (up = &(daemon->watches), w = daemon->watches; w; w = w->next)
97
 
    if (w->watch == watch)
98
 
      {
99
 
        *up = w->next;
100
 
        free(w);
101
 
      }
102
 
    else
103
 
      up = &(w->next);
 
96
  for (up = &(daemon->watches), w = daemon->watches; w; w = tmp)
 
97
    {
 
98
      tmp = w->next;
 
99
      if (w->watch == watch)
 
100
        {
 
101
          *up = tmp;
 
102
          free(w);
 
103
        }
 
104
      else
 
105
        up = &(w->next);
 
106
    }
104
107
 
105
108
  w = data; /* no warning */
106
109
}
340
343
            }
341
344
          
342
345
          /* dup the string because it gets modified during parsing */
 
346
          if (dup)
 
347
            free(dup);
343
348
          if (!(dup = str_domain = whine_malloc(strlen(str)+1)))
344
349
            break;
345
 
 
 
350
          
346
351
          strcpy(str_domain, str);
347
352
 
348
353
          /* point to address part of old string for error message */
400
405
            }
401
406
          
402
407
          /* dup the string because it gets modified during parsing */
 
408
          if (dup)
 
409
            free(dup);
403
410
          if (!(dup = str_addr = whine_malloc(strlen(str)+1)))
404
411
            break;
405
 
           
 
412
          
406
413
          strcpy(str_addr, str);
407
414
        }
408
415