~ubuntu-branches/ubuntu/wily/grilo/wily

« back to all changes in this revision

Viewing changes to libs/net/grl-net-mock.c

  • Committer: Package Import Robot
  • Author(s): Alberto Garcia
  • Date: 2014-03-19 16:12:33 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20140319161233-03kxmz2x6btjv2tg
Tags: 0.2.10-1
* New upstream release.
* debian/control: update build dependency on libglib2.0-dev to 2.34.
* debian/libgrilo-0.2-1.symbols: update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
    g_simple_async_result_complete_in_idle (G_SIMPLE_ASYNC_RESULT (result));
120
120
    g_object_unref (result);
121
121
    g_free (new_url);
122
 
    if (data_file)
123
 
      g_free (data_file);
124
 
    if (full_path)
125
 
      g_free (full_path);
 
122
    g_clear_pointer (&data_file, g_free);
 
123
    g_clear_pointer (&full_path, g_free);
 
124
 
126
125
    return;
127
126
  }
128
 
  if (data_file)
129
 
    g_free (data_file);
130
 
  if (full_path)
131
 
    g_free (full_path);
 
127
  g_clear_pointer (&data_file, g_free);
 
128
  g_clear_pointer (&full_path, g_free);
132
129
 
133
130
  g_simple_async_result_set_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result),
134
131
                                             new_url,
156
153
  }
157
154
  g_file_get_contents (full_path, content, length, &error);
158
155
 
159
 
  if (data_file)
160
 
    g_free (data_file);
161
 
 
162
 
  if (full_path)
163
 
    g_free (full_path);
 
156
  g_clear_pointer (&data_file, g_free);
 
157
  g_clear_pointer (&full_path, g_free);
164
158
}
165
159
 
166
160
void init_mock_requester (GrlNetWc *self)
206
200
 
207
201
  if (!enable_mocking) {
208
202
    g_free (config_filename);
209
 
    g_key_file_unref (config);
210
 
    config = NULL;
 
203
    g_clear_pointer (&config, g_key_file_unref);
211
204
    return;
212
205
  }
213
206
 
266
259
  }
267
260
 
268
261
  if (g_atomic_int_dec_and_test (&refcount)) {
269
 
    if (config) {
270
 
      g_key_file_unref (config);
271
 
    }
272
 
 
273
 
    if (base_path) {
274
 
      g_free (base_path);
275
 
    }
276
 
 
277
 
    if (ignored_parameters) {
278
 
      g_regex_unref (ignored_parameters);
279
 
    }
 
262
    g_clear_pointer (&config, g_key_file_unref);
 
263
    g_clear_pointer (&base_path, g_free);
 
264
    g_clear_pointer (&ignored_parameters, g_regex_unref);
280
265
  }
281
266
}
282
267