branch: elpa/emacsql
commit 374726060d74df0e2bcb9d0355ff41e2c400ed30
Author: Christopher Wellons <well...@nullprogram.com>
Commit: Christopher Wellons <well...@nullprogram.com>

    Fix buffer struct allocation size (fixes #91)
    
    Thanks to Sean Devlin for finding this.
---
 sqlite/emacsql.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sqlite/emacsql.c b/sqlite/emacsql.c
index 89cb144bd8..5c5c0f7eb8 100644
--- a/sqlite/emacsql.c
+++ b/sqlite/emacsql.c
@@ -42,7 +42,7 @@ typedef struct {
 } buffer;
 
 buffer* buffer_create() {
-    buffer *buffer = malloc(sizeof(buffer));
+    buffer *buffer = malloc(sizeof(*buffer));
     buffer->size = 4096;
     buffer->buffer = malloc(buffer->size * sizeof(char));
     return buffer;

Reply via email to