mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
Trivial change to allocate memory using pulse methods.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2364 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
a08d733fd1
commit
a0d3582fb1
1 changed files with 3 additions and 3 deletions
|
|
@ -33,6 +33,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <pulse/xmalloc.h>
|
||||||
|
|
||||||
#include "base64.h"
|
#include "base64.h"
|
||||||
|
|
||||||
static char base64_chars[] =
|
static char base64_chars[] =
|
||||||
|
|
@ -54,9 +56,7 @@ int pa_base64_encode(const void *data, int size, char **str)
|
||||||
int c;
|
int c;
|
||||||
const unsigned char *q;
|
const unsigned char *q;
|
||||||
|
|
||||||
p = s = (char *) malloc(size * 4 / 3 + 4);
|
p = s = pa_xnew(char, size * 4 / 3 + 4);
|
||||||
if (p == NULL)
|
|
||||||
return -1;
|
|
||||||
q = (const unsigned char *) data;
|
q = (const unsigned char *) data;
|
||||||
i = 0;
|
i = 0;
|
||||||
for (i = 0; i < size;) {
|
for (i = 0; i < size;) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue