Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 272050 | Differences between
and this patch

Collapse All | Expand All

(-)client/utils.c (-5 / +16 lines)
Lines 30-35 Link Here
30
#include <sys/time.h>
30
#include <sys/time.h>
31
#include <time.h>
31
#include <time.h>
32
#include <sys/wait.h>
32
#include <sys/wait.h>
33
#include <stdint.h>
33
34
34
#include <expat.h>
35
#include <expat.h>
35
36
Lines 70-83 Link Here
70
    if (!strcmp("preferences", name)) {
71
    if (!strcmp("preferences", name)) {
71
	while (atts[i]) {
72
	while (atts[i]) {
72
	    if (!strcmp("nick", atts[i])) {
73
	    if (!strcmp("nick", atts[i])) {
74
		free(prefs->nick);
73
		prefs->nick = strdup(atts[i+1]);
75
		prefs->nick = strdup(atts[i+1]);
74
	    } else if (!strcmp("url", atts[i])) {
76
	    } else if (!strcmp("url", atts[i])) {
77
		free(prefs->url);
75
		prefs->url = strdup(atts[i+1]);
78
		prefs->url = strdup(atts[i+1]);
76
	    } else if (!strcmp("password", atts[i])) {
79
	    } else if (!strcmp("password", atts[i])) {
80
		free(prefs->password);
77
		prefs->password = strdup(atts[i+1]);
81
		prefs->password = strdup(atts[i+1]);
78
	    } else if (!strcmp("video_driver", atts[i])) {
82
	    } else if (!strcmp("video_driver", atts[i])) {
83
		free(prefs->video_driver);
79
		prefs->video_driver = strdup(atts[i+1]);
84
		prefs->video_driver = strdup(atts[i+1]);
80
	    } else if (!strcmp("uid", atts[i])) {
85
	    } else if (!strcmp("uid", atts[i])) {
86
		free(prefs->uid);
81
		prefs->uid = strdup(atts[i+1]);
87
		prefs->uid = strdup(atts[i+1]);
82
	    } else if (!strcmp("cache", atts[i])) {
88
	    } else if (!strcmp("cache", atts[i])) {
83
		prefs->cache_size = atoi(atts[i+1]);
89
		prefs->cache_size = atoi(atts[i+1]);
Lines 168-174 Link Here
168
/* 64 random bits encoded as ascii */
174
/* 64 random bits encoded as ascii */
169
void make_uniqueid(prefs_t *prefs) {
175
void make_uniqueid(prefs_t *prefs) {
170
  static char *rdevice = "/dev/urandom";
176
  static char *rdevice = "/dev/urandom";
171
  unsigned long d[2];
177
  uint32_t d[2];
172
  int rfd;
178
  int rfd;
173
  struct timeval tv;
179
  struct timeval tv;
174
  char ub[17];
180
  char ub[17];
Lines 190-204 Link Here
190
  d[0] ^= tv.tv_sec;
196
  d[0] ^= tv.tv_sec;
191
  d[1] ^= tv.tv_usec;
197
  d[1] ^= tv.tv_usec;
192
  snprintf(ub, 17, "%08lX%08lX", d[0], d[1]);
198
  snprintf(ub, 17, "%08lX%08lX", d[0], d[1]);
199
  free(prefs->uid);
193
  prefs->uid = strdup(ub);
200
  prefs->uid = strdup(ub);
194
}
201
}
195
202
196
void default_rc(prefs_t *prefs) {
203
void default_rc(prefs_t *prefs) {
197
    prefs->nick = "";
204
    free(prefs->nick);
198
    prefs->url = "";
205
    prefs->nick = strdup("");
199
    prefs->password = "";
206
    free(prefs->url);
207
    prefs->url = strdup("");
208
    free(prefs->password);
209
    prefs->password = strdup("");
200
    prefs->cache_size = 2000;
210
    prefs->cache_size = 2000;
201
    prefs->video_driver = "";
211
    free(prefs->video_driver);
212
    prefs->video_driver = strdup("");
202
    make_uniqueid(prefs);
213
    make_uniqueid(prefs);
203
    prefs->frame_rate = 23.0;
214
    prefs->frame_rate = 23.0;
204
    prefs->nrepeats = 2;
215
    prefs->nrepeats = 2;
(-)client/electricsheep.c (+1 lines)
Lines 735-740 Link Here
735
	    exit(1);
735
	    exit(1);
736
	}
736
	}
737
	av_free_packet(&opkt);
737
	av_free_packet(&opkt);
738
	av_free_packet(&ipkt);
738
    }
739
    }
739
    av_close_input_file(ictx);
740
    av_close_input_file(ictx);
740
}
741
}
(-)client/electricsheep-preferences.c (+5 lines)
Lines 52-62 Link Here
52
GtkButton *test_button;
52
GtkButton *test_button;
53
53
54
void clear_prefs(prefs_t *prefs) {
54
void clear_prefs(prefs_t *prefs) {
55
    free(prefs->nick);
55
    prefs->nick = NULL;
56
    prefs->nick = NULL;
57
    free(prefs->url);
56
    prefs->url = NULL;
58
    prefs->url = NULL;
59
    free(prefs->password);
57
    prefs->password = NULL;
60
    prefs->password = NULL;
61
    free(prefs->video_driver);
58
    prefs->video_driver = NULL;
62
    prefs->video_driver = NULL;
59
    prefs->cache_size = -1;
63
    prefs->cache_size = -1;
64
    free(prefs->uid);
60
    prefs->uid = NULL;
65
    prefs->uid = NULL;
61
    prefs->frame_rate = -1.0;
66
    prefs->frame_rate = -1.0;
62
    prefs->play_evenly = 1.0;
67
    prefs->play_evenly = 1.0;

Return to bug 272050