Mercurial > pidgin
comparison src/protocols/toc/toc.c @ 7606:08c9d0dcf906
[gaim-migrate @ 8229]
" Some things allocated with g_malloc() were being
free()'d instead of g_free()'d
This patch fixes the ones I managed to find." --Stu Tomlinson (nosnilmot)
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Sun, 23 Nov 2003 15:32:25 +0000 |
| parents | 1930e3d00ecd |
| children | 0555e59dfba9 |
comparison
equal
deleted
inserted
replaced
| 7605:7b9630667f43 | 7606:08c9d0dcf906 |
|---|---|
| 307 default: | 307 default: |
| 308 j++; | 308 j++; |
| 309 } | 309 } |
| 310 | 310 |
| 311 /* Allocate a string */ | 311 /* Allocate a string */ |
| 312 ret = (char *)malloc((j+1) * sizeof(char)); | 312 ret = (char *)g_malloc((j+1) * sizeof(char)); |
| 313 | 313 |
| 314 /* Copy the string */ | 314 /* Copy the string */ |
| 315 for (i=0, j=0; msg[i]; i++) | 315 for (i=0, j=0; msg[i]; i++) |
| 316 switch (msg[i]) { | 316 switch (msg[i]) { |
| 317 case '$': | 317 case '$': |
| 434 slen += 1; | 434 slen += 1; |
| 435 } | 435 } |
| 436 | 436 |
| 437 ret = toc_write(tdt->toc_fd, obuf, slen); | 437 ret = toc_write(tdt->toc_fd, obuf, slen); |
| 438 free(obuf); | 438 free(obuf); |
| 439 free(escaped); | 439 g_free(escaped); |
| 440 | 440 |
| 441 return ret; | 441 return ret; |
| 442 } | 442 } |
| 443 | 443 |
| 444 static int wait_reply(GaimConnection *gc, char *buffer, size_t buflen) | 444 static int wait_reply(GaimConnection *gc, char *buffer, size_t buflen) |
