Index: include/libroar/buffer.h
===================================================================
--- include/libroar/buffer.h	(revision 3517)
+++ include/libroar/buffer.h	(revision 3764)
@@ -80,4 +80,6 @@
 int roar_buffer_add      (struct roar_buffer *  buf, struct roar_buffer *  next);
 
+int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data);
+
 int roar_buffer_ring_new (struct roar_buffer ** buf, size_t len, int free_running);
 
Index: libroar/buffer.c
===================================================================
--- libroar/buffer.c	(revision 3517)
+++ libroar/buffer.c	(revision 3764)
@@ -36,13 +36,21 @@
 #include "libroar.h"
 
+// TODO: convert this to a macro.
+// TODO: but still provide a function->symbol
+// TODO: so we do not need to change SONAME-Version
+// TODO: Clean this up in next SONAME-Version
 int roar_buffer_new      (struct roar_buffer ** buf, size_t len) {
- void * data;
-
- if ((data = roar_mm_malloc(len)) == NULL) {
-  return -1;
- }
-
- if ( roar_buffer_new_no_ma(buf, len, data) == -1 ) {
-  roar_mm_free(data);
+ return roar_buffer_new_data(buf, len, NULL);
+}
+
+int roar_buffer_new_data (struct roar_buffer ** buf, size_t len, void ** data) {
+ void * bufdata;
+
+ if ((bufdata = roar_mm_malloc(len)) == NULL) {
+  return -1;
+ }
+
+ if ( roar_buffer_new_no_ma(buf, len, bufdata) == -1 ) {
+  roar_mm_free(bufdata);
   return -1;
  }
@@ -50,7 +58,10 @@
  if ( roar_buffer_set_flag(*buf, ROAR_BUFFER_FLAG_NOFREE, ROAR_BUFFER_RESET) == -1 ) {
   roar_buffer_free(*buf);
-  roar_mm_free(data);
-  return -1;
- }
+  roar_mm_free(bufdata);
+  return -1;
+ }
+
+ if ( data != NULL )
+  *data = bufdata;
 
  return 0;
Index: libroar/vio_pipe.c
===================================================================
--- libroar/vio_pipe.c	(revision 3517)
+++ libroar/vio_pipe.c	(revision 3764)
@@ -326,11 +326,6 @@
     }
 
-    if ( roar_buffer_new(&next, count) == -1 )
-     return -1;
-
-    if ( roar_buffer_get_data(next, &data) == -1 ) {
-     roar_buffer_free(next);
-     return -1;
-    }
+    if ( roar_buffer_new_data(&next, count, &data) == -1 )
+     return -1;
 
     memcpy(data, buf, count);
Index: libroar/vio_proto.c
===================================================================
--- libroar/vio_proto.c	(revision 3517)
+++ libroar/vio_proto.c	(revision 3764)
@@ -274,11 +274,6 @@
  calls->write = NULL; // Disable write as we do not support this
 
- if ( roar_buffer_new(&bufbuf, 1024) == -1 )
-  return -1;
-
- if ( roar_buffer_get_data(bufbuf, &buf) == -1 ) {
-  roar_buffer_free(bufbuf);
-  return -1;
- }
+ if ( roar_buffer_new_data(&bufbuf, 1024, &buf) == -1 )
+  return -1;
 
  ROAR_DBG("roar_vio_open_proto_http(calls=%p, dst=%p, host='%s', file='%s') = ?", calls, dst, host, file);
Index: roard/beep.c
===================================================================
--- roard/beep.c	(revision 3630)
+++ roard/beep.c	(revision 3764)
@@ -73,9 +73,5 @@
  ROAR_DBG("beep_fill_buffer(beep=%p, info=%p) = ?", beep, info);
 
- if ( roar_buffer_new(&buf, samples) == -1 )
-  return NULL;
-
- if ( roar_buffer_get_data(buf, &data) == -1 ) {
-  roar_buffer_free(buf);
+ if ( roar_buffer_new_data(&buf, samples, &data) == -1 ) {
   ROAR_DBG("beep_fill_buffer(beep=%p, info=%p) = NULL", beep, info);
   return NULL;
Index: roard/codecfilter_fishsound.c
===================================================================
--- roard/codecfilter_fishsound.c	(revision 3517)
+++ roard/codecfilter_fishsound.c	(revision 3764)
@@ -50,8 +50,5 @@
  }
 
- if ( roar_buffer_new(&buf, frames*stream->info.bits*stream->info.channels/8) == -1 )
-  return -1;
-
- if ( roar_buffer_get_data(buf, &data.v) == -1 )
+ if ( roar_buffer_new_data(&buf, frames*stream->info.bits*stream->info.channels/8, &data.v) == -1 )
   return -1;
 
Index: roard/midi.c
===================================================================
--- roard/midi.c	(revision 3594)
+++ roard/midi.c	(revision 3764)
@@ -157,11 +157,9 @@
  }
 
- if ( roar_buffer_new(&b, MIDI_READ_SIZE) == -1 ) {
+ if ( roar_buffer_new_data(&b, MIDI_READ_SIZE, (void**)&buf) == -1 ) {
   ROAR_ERR("midi_check_stream(*): Can not alloc buffer space!");
   ROAR_DBG("midi_check_stream(*) = -1");
   return -1;
  }
-
- roar_buffer_get_data(b, (void **)&buf);
 
  if ( (len = stream_vio_s_read(ss, buf, MIDI_READ_SIZE)) < 1 ) {
@@ -480,9 +478,5 @@
  *buf = (void*)(*mes = NULL);
 
- if ( roar_buffer_new(buf, sizeof(struct midi_message)) == -1 )
-  return -1;
-
- if ( roar_buffer_get_data(*buf, (void**)mes) == -1 ) {
-  roar_buffer_free(*buf);
+ if ( roar_buffer_new_data(buf, sizeof(struct midi_message), (void**)mes) == -1 ) {
   *buf = (void*)(*mes = NULL);
   return -1;
Index: roard/raw.c
===================================================================
--- roard/raw.c	(revision 3517)
+++ roard/raw.c	(revision 3764)
@@ -45,11 +45,6 @@
   return -1;
 
- if ( roar_buffer_new(&buf, RAW_READ_LEN) == -1 )
+ if ( roar_buffer_new_data(&buf, RAW_READ_LEN, &data) == -1 )
   return -1;
-
- if ( roar_buffer_get_data(buf, &data) == -1 ) {
-  roar_buffer_free(buf);
-  return -1;
- }
 
  if ( (len = stream_vio_s_read(ss, data, RAW_READ_LEN)) < 1 ) {
Index: roard/req.c
===================================================================
--- roard/req.c	(revision 3745)
+++ roard/req.c	(revision 3764)
@@ -1034,11 +1034,9 @@
  char               * buf;
 
- if ( roar_buffer_new(&b, mes->datalen) == -1 ) {
+ if ( roar_buffer_new_data(&b, mes->datalen, (void **)&buf) == -1 ) {
   ROAR_ERR("req_on_add_data(*): Can not alloc buffer space!");
   ROAR_DBG("req_on_add_data(*) = -1");
   return -1;
  }
-
- roar_buffer_get_data(b, (void **)&buf);
 
  if ( data == NULL ) {
