summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h3
-rw-r--r--source3/lib/util.c13
2 files changed, 15 insertions, 1 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 6d9d083bc1..ed725b722d 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1582,7 +1582,7 @@ char *namestr(struct nmb_name *n);
struct packet_struct *copy_packet(struct packet_struct *packet);
void free_packet(struct packet_struct *packet);
struct packet_struct *read_packet(int fd,enum packet_type packet_type);
-void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope);
+void make_nmb_name( struct nmb_name *n, char *name, int type, char *this_scope );
BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
BOOL send_packet(struct packet_struct *p);
struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
@@ -1973,6 +1973,7 @@ BOOL is_a_socket(int fd);
BOOL next_token(char **ptr,char *buff,char *sep);
char **toktocliplist(int *ctok, char *sep);
void *MemMove(void *dest,void *src,int size);
+void *mem_dup( void *from, int size );
void array_promote(char *array,int elsize,int element);
void set_socket_options(int fd, char *options);
void close_sockets(void );
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 2bd7636fb0..905809f111 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -516,6 +516,19 @@ void *MemMove(void *dest,void *src,int size)
}
#endif
+/* ************************************************************************* **
+ * Duplicate a block of memory.
+ * ************************************************************************* **
+ */
+void *mem_dup( void *from, int size )
+ {
+ void *tmp;
+
+ tmp = malloc( size );
+ if( NULL != tmp )
+ (void)memcpy( tmp, from, size );
+ return( tmp );
+ } /* mem_dup */
/****************************************************************************
prompte a dptr (to make it recently used)