Mercurial > audlegacy
comparison libaudacious/beepctrl.c @ 1448:3b1c464cbbb0 trunk
[svn] Seems safer to me to free this way, assuming I'm not misreading.
Hey. At least it doesn't crash.
author | nemo |
---|---|
date | Fri, 28 Jul 2006 07:21:20 -0700 |
parents | 7ca5bef8d9ee |
children | 9bb6d5ce6d95 |
comparison
equal
deleted
inserted
replaced
1447:7ca5bef8d9ee | 1448:3b1c464cbbb0 |
---|---|
351 static gchar *workbuf, *keybuf; | 351 static gchar *workbuf, *keybuf; |
352 gint iport; | 352 gint iport; |
353 gchar *tmp = g_strdup(in); | 353 gchar *tmp = g_strdup(in); |
354 | 354 |
355 /* split out the host/port and key */ | 355 /* split out the host/port and key */ |
356 tmp += 6; | |
357 workbuf = tmp; | 356 workbuf = tmp; |
358 | 357 workbuf += 6; |
359 keybuf = strchr(tmp, '/'); | 358 |
359 keybuf = strchr(workbuf, '/'); | |
360 *keybuf++ = '\0'; | 360 *keybuf++ = '\0'; |
361 | 361 |
362 *key = g_strdup(keybuf); | 362 *key = g_strdup(keybuf); |
363 | 363 |
364 if (strchr(workbuf, ':') == NULL) | 364 if (strchr(workbuf, ':') == NULL) |
383 { | 383 { |
384 static gchar *workbuf, *keybuf; | 384 static gchar *workbuf, *keybuf; |
385 gchar *tmp = g_strdup(in); | 385 gchar *tmp = g_strdup(in); |
386 | 386 |
387 /* split out the host/port and key */ | 387 /* split out the host/port and key */ |
388 tmp += 7; | |
389 workbuf = tmp; | 388 workbuf = tmp; |
390 | 389 workbuf += 7; |
391 keybuf = strchr(tmp, '/'); | 390 |
391 keybuf = strchr(workbuf, '/'); | |
392 *keybuf++ = '\0'; | 392 *keybuf++ = '\0'; |
393 | 393 |
394 *key = g_strdup(keybuf); | 394 *key = g_strdup(keybuf); |
395 | 395 |
396 g_free(tmp); | 396 g_free(tmp); |